Skip to content

Commit b3d7d09

Browse files
committed
chore: add lint
1 parent 3cc3c03 commit b3d7d09

File tree

11 files changed

+5458
-6271
lines changed

11 files changed

+5458
-6271
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
pnpm-lock.yaml

.eslintrc.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"commonjs": true,
6+
"es2021": true
7+
},
8+
"parser": "vue-eslint-parser",
9+
"parserOptions": {
10+
"parser": "@typescript-eslint/parser",
11+
"ecmaVersion": "latest",
12+
"ecmaFeatures": {
13+
"jsx": true
14+
}
15+
},
16+
"extends": [
17+
"eslint:recommended",
18+
"plugin:@typescript-eslint/recommended",
19+
"plugin:vue/vue3-recommended",
20+
"prettier"
21+
],
22+
"plugins": ["@typescript-eslint", "vue", "prettier"],
23+
"rules": {
24+
"prettier/prettier": "off",
25+
"arrow-body-style": "off",
26+
"prefer-arrow-callback": "off",
27+
"@typescript-eslint/no-explicit-any": "off",
28+
"@typescript-eslint/no-unused-vars": "off",
29+
"@typescript-eslint/ban-types": "off",
30+
"@typescript-eslint/no-var-requires": "off",
31+
"vue/multi-word-component-names": "off",
32+
"no-undef": "off",
33+
"no-html-link-for-pages": "off",
34+
"no-constant-condition": [
35+
"error",
36+
{
37+
"checkLoops": false
38+
}
39+
]
40+
},
41+
"overrides": [
42+
{
43+
"env": {
44+
"node": true
45+
},
46+
"files": [".eslintrc.{js,cjs,json}"],
47+
"parserOptions": {
48+
"sourceType": "script"
49+
},
50+
"rules": {
51+
"@typescript-eslint/no-var-requires": "off"
52+
}
53+
}
54+
]
55+
}

.husky/commit-msg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npm run commitlint ${1}
4+
npx --no -- commitlint --edit
5+
# npm run commitlint ${1}

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npm run format
4+
npx lint-staged

package.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44
"version": "0.0.0",
55
"private": true,
66
"scripts": {
7+
"prepare": "husky install",
78
"dev": "vite",
89
"build": "vue-tsc && vite build",
910
"preview": "vite preview",
10-
"prepare": "husky install",
1111
"typecheck": "vue-tsc --noEmit",
1212
"commitlint": "commitlint --edit",
13+
"lint": "eslint ./ --ext .ts,.js,.json,.vue --max-warnings=0",
14+
"lint:fix": "eslint --fix ./ --ext .ts,.js,.vue",
1315
"format": "prettier --write .",
1416
"test": "vitest"
1517
},
18+
"lint-staged": {
19+
"*.{ts,js,jsx,vue}": [
20+
"eslint",
21+
"prettier --write"
22+
]
23+
},
1624
"dependencies": {
1725
"@unocss/reset": "^0.58.5",
1826
"@vueuse/core": "^10.9.0",
@@ -29,12 +37,20 @@
2937
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
3038
"@iconify-json/carbon": "^1.1.31",
3139
"@types/node": "^20.11.24",
40+
"@typescript-eslint/eslint-plugin": "^7.4.0",
41+
"@typescript-eslint/parser": "^7.4.0",
3242
"@vitejs/plugin-vue": "^4.6.2",
3343
"@vitejs/plugin-vue-jsx": "^3.1.0",
44+
"eslint": "^8.57.0",
45+
"eslint-config-prettier": "^9.1.0",
46+
"eslint-plugin-prettier": "^5.1.3",
47+
"eslint-plugin-vue": "^9.24.0",
3448
"husky": "^8.0.3",
49+
"lint-staged": "^15.2.2",
3550
"pnpm": "^8.15.4",
3651
"prettier": "^3.2.5",
3752
"sass": "^1.71.1",
53+
"ts-node": "^10.9.2",
3854
"typescript": "^5.3.3",
3955
"unocss": "^0.58.5",
4056
"unplugin-auto-import": "^0.17.5",
@@ -43,6 +59,7 @@
4359
"vite": "^5.1.4",
4460
"vite-plugin-vue-devtools": "1.0.0-rc.8",
4561
"vitest": "^1.3.1",
62+
"vue-eslint-parser": "^9.4.2",
4663
"vue-tsc": "^1.8.27"
4764
}
4865
}

0 commit comments

Comments
 (0)