Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(ui): setup format check tool #177

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/dubboctl-ui-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,29 @@ on:
- Makefile

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui-vue3
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: "ui-vue3/.nvmrc"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Lint
run: |
# disable eslint for now as the new ui is under heavy development
# when the new ui is ready, we can enable eslint again (please also update the .lintstagedrc.json file)
# yarn lint
yarn prettier-check

update-ui:
runs-on: ubuntu-latest
if: github.repository == 'apache/dubbo-kubernetes'
Expand Down
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ header:
- '**/testdata/**'
- '**/deploy.tpl'
- '**/docs/**'
- '**/.husky/pre-commit'
- '**/.nvmrc'
- '**/**.txtar'
- '**/**gen.go'
Expand Down
4 changes: 4 additions & 0 deletions ui-vue3/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
6 changes: 6 additions & 0 deletions ui-vue3/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.{vue,ts,json}": [
// "lint:fix",
"prettier-format"
]
}
11 changes: 7 additions & 4 deletions ui-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"scripts": {
"dev": "vite",
"check:i18n": "node --loader ts-node/esm src/base/i18n/sortI18n.ts",
"build": "prettier --write src/ && vite build",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
"build": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/"
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"prepare": "husky install",
"prettier-format": "prettier --write src/",
"prettier-check": "prettier --check src/"
},
"resolutions": {
"jackspeak": "2.1.1"
Expand Down Expand Up @@ -54,6 +56,7 @@
"eslint": "^8.49.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-vue": "^9.17.0",
"husky": "^9.0.6",
"jsdom": "^23.0.1",
"npm-run-all2": "^6.1.1",
"prettier": "^3.0.3",
Expand Down
5 changes: 5 additions & 0 deletions ui-vue3/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,11 @@ human-signals@^5.0.0:
resolved "https://registry.npmmirror.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28"
integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==

husky@^9.0.6:
version "9.0.6"
resolved "https://registry.npmmirror.com/husky/-/husky-9.0.6.tgz#cee0245d60480b12279cf492ec6cfc1aeb7fa759"
integrity sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA==

[email protected], [email protected], iconv-lite@^0.6.3:
version "0.6.3"
resolved "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
Expand Down
Loading