Skip to content

Commit d2eb22b

Browse files
committed
Add eslint + prettier
1 parent 29f7d49 commit d2eb22b

File tree

6 files changed

+1616
-33
lines changed

6 files changed

+1616
-33
lines changed

.eslintignore

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

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"es2021": true,
4+
"mocha": true,
5+
"node": true
6+
},
7+
"extends": ["standard-with-typescript", "prettier"],
8+
"parserOptions": {
9+
"ecmaVersion": 2021,
10+
"project": "tsconfig.json",
11+
"sourceType": "module"
12+
},
13+
"plugins": ["@typescript-eslint"],
14+
"rules": {
15+
"@typescript-eslint/explicit-function-return-type": "off",
16+
"@typescript-eslint/naming-convention": "off",
17+
"@typescript-eslint/no-namespace": "off",
18+
"@typescript-eslint/restrict-plus-operands": "off",
19+
"@typescript-eslint/restrict-template-expressions": "off",
20+
"@typescript-eslint/strict-boolean-expressions": "off"
21+
}
22+
}

.prettierignore

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

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 160,
3+
"semi": false,
4+
"singleQuote": true
5+
}

package.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@
1919
"scripts": {
2020
"dev": "tsc -w",
2121
"build": "rm -rf dist && tsc && cp package.json *.md dist && rm -rf dist/test",
22-
"sync": "curl -X PUT 'https://npm.taobao.org/sync/coa-wx-isv?sync_upstream=true'",
23-
"publish-prerelease": "yarn build && yarn version --prerelease && cp package.json dist && cd dist && npm publish"
22+
"lint": "eslint . ",
23+
"prettier": "prettier -w .",
24+
"sync": "curl -X PUT 'https://npm.taobao.org/sync/coa-wx-isv?sync_upstream=true'"
2425
},
2526
"dependencies": {
26-
"coa-echo": "^1.0.8",
27+
"coa-echo": "^1.1.1",
2728
"coa-error": "^1.5.2",
28-
"coa-helper": "^1.1.1",
29+
"coa-helper": "^1.2.1",
2930
"coa-xml": "^1.0.2"
3031
},
3132
"devDependencies": {
32-
"@types/node": "^15.3.1",
33-
"typescript": "^4.2.4"
33+
"@types/node": "^15.6.1",
34+
"@typescript-eslint/eslint-plugin": "^4.25.0",
35+
"eslint": "^7.27.0",
36+
"eslint-config-prettier": "^8.3.0",
37+
"eslint-config-standard-with-typescript": "^20.0.0",
38+
"eslint-plugin-import": "^2.23.4",
39+
"eslint-plugin-node": "^11.1.0",
40+
"eslint-plugin-promise": "^5.1.0",
41+
"prettier": "^2.3.0",
42+
"typescript": "^4.3.2"
3443
}
3544
}

0 commit comments

Comments
 (0)