Skip to content

Commit c21bb3e

Browse files
committed
Use eslint+prettier
1 parent 08af139 commit c21bb3e

15 files changed

+3671
-2783
lines changed

.eslintrc.cjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
browser: true,
6+
},
7+
parser: "@typescript-eslint/parser",
8+
plugins: ["@typescript-eslint"],
9+
extends: [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:prettier/recommended",
13+
],
14+
rules: {
15+
"no-prototype-builtins": 0,
16+
"@typescript-eslint/no-explicit-any": 0,
17+
"@typescript-eslint/no-non-null-assertion": 0,
18+
"@typescript-eslint/no-var-requires": 0,
19+
},
20+
};

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"fetch-mdn": "npm run build && node ./lib/mdnfetcher.js",
1111
"fetch": "echo This could take a few minutes... && npm run fetch-idl && npm run fetch-mdn",
1212
"baseline-accept": "cpx \"generated\\*\" baselines\\",
13-
"test": "tsc -p ./tsconfig.json && node ./lib/index.js && node ./lib/test.js",
13+
"lint": "eslint --max-warnings 0 src",
14+
"test": "npm run lint && npm run build && node ./lib/test.js",
1415
"danger": "danger",
1516
"migrate": "node ./lib/migrate-to-tsc.js"
1617
},
@@ -20,14 +21,20 @@
2021
"@types/node": "^14.6.4",
2122
"@types/node-fetch": "^2.5.7",
2223
"@types/webidl2": "^23.13.2",
24+
"@typescript-eslint/eslint-plugin": "^4.16.1",
25+
"@typescript-eslint/parser": "^4.16.1",
2326
"cpx2": "^2.0.0",
2427
"danger": "^10.5.4",
28+
"eslint": "^7.21.0",
29+
"eslint-config-prettier": "^8.1.0",
30+
"eslint-plugin-prettier": "^3.3.1",
2531
"jsdom": "^16.4.0",
2632
"node-fetch": "^2.6.1",
2733
"parse-diff": "^0.7.0",
34+
"prettier": "^2.2.1",
2835
"print-diff": "^1.0.0",
2936
"styleless-innertext": "^1.1.2",
30-
"typescript": "4.1.0-dev.20200908",
37+
"typescript": "^4.2.3",
3138
"webidl2": "^23.13.0"
3239
}
3340
}

0 commit comments

Comments
 (0)