Skip to content

Commit aa7e383

Browse files
committed
perf: setup code style
1 parent 67a544b commit aa7e383

File tree

5 files changed

+1147
-5
lines changed

5 files changed

+1147
-5
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/dist/**

.eslintrc.cjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
env: {
4+
es2021: true,
5+
},
6+
extends: [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:prettier/recommended",
10+
],
11+
overrides: [],
12+
parser: "@typescript-eslint/parser",
13+
parserOptions: {
14+
ecmaVersion: "latest",
15+
sourceType: "module",
16+
},
17+
plugins: ["@typescript-eslint"],
18+
rules: {
19+
"@typescript-eslint/no-unused-vars": "off",
20+
"@typescript-eslint/no-explicit-any": "off",
21+
"@typescript-eslint/no-non-null-assertion": "off",
22+
"@typescript-eslint/ban-ts-comment": "off",
23+
"@typescript-eslint/ban-types": "off",
24+
"@typescript-eslint/no-this-alias": "off",
25+
"@typescript-eslint/no-empty-function": "off",
26+
"no-self-assign": "off",
27+
},
28+
};

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": true,
4+
"endOfLine": "auto"
5+
}

package.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
"dev": "unbuild --stub",
99
"build": "unbuild",
1010
"typecheck": "tsc --noEmit",
11-
"prepublishOnly": "npm run build"
11+
"prepublishOnly": "npm run build",
12+
"lint": "eslint ."
13+
},
14+
"husky": {
15+
"hooks": {
16+
"pre-commit": "exit 0"
17+
}
1218
},
1319
"keywords": [
1420
"jwcjs"
@@ -30,12 +36,26 @@
3036
"@types/minimist": "^1.2.2",
3137
"@types/node": "^18.11.17",
3238
"@types/prompts": "^2.4.2",
39+
"@typescript-eslint/eslint-plugin": "^5.47.0",
40+
"@typescript-eslint/parser": "^5.47.0",
3341
"cross-spawn": "^7.0.3",
42+
"eslint": "^8.30.0",
43+
"eslint-config-prettier": "^8.5.0",
44+
"eslint-plugin-prettier": "^4.2.1",
45+
"husky": "^8.0.2",
3446
"kolorist": "^1.6.0",
47+
"lint-staged": "^13.1.0",
3548
"minimist": "^1.2.7",
49+
"prettier": "^2.8.1",
3650
"prompts": "^2.4.2",
51+
"rimraf": "^3.0.2",
3752
"ts-node": "^10.9.1",
3853
"typescript": "^4.9.4",
3954
"unbuild": "^1.0.2"
55+
},
56+
"lint-staged": {
57+
"*.{js,ts,css,json}": [
58+
"prettier --write"
59+
]
4060
}
4161
}

0 commit comments

Comments
 (0)