Skip to content

Commit db00740

Browse files
committed
Migrate linting from TSLint to ESLint.
1 parent d6ce83c commit db00740

File tree

6 files changed

+2623
-721
lines changed

6 files changed

+2623
-721
lines changed

.eslintrc

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"ecmaVersion": 6,
15+
"project": "./tsconfig.json",
16+
"sourceType": "module"
17+
},
18+
"plugins": [
19+
"eslint-plugin-deprecation",
20+
"eslint-plugin-no-null",
21+
"@typescript-eslint"
22+
],
23+
"root": true,
24+
"rules": {
25+
// Configure additional checks
26+
"comma-spacing": "error",
27+
"deprecation/deprecation": "error",
28+
"no-null/no-null": "error",
29+
"eol-last": "error",
30+
"indent": ["error", "tab", {"SwitchCase": 1}],
31+
"no-console": "error",
32+
"no-trailing-spaces": "error",
33+
"prefer-const": ["error", {"ignoreReadBeforeAssign": true}],
34+
"semi": "error",
35+
"space-infix-ops": "error",
36+
"@typescript-eslint/ban-tslint-comment": "error",
37+
38+
// Disable some recommended checks (until we can address them)
39+
"no-cond-assign": "off",
40+
"no-fallthrough": "off",
41+
"no-prototype-builtins": "off",
42+
"no-useless-escape": "off",
43+
"prefer-spread": "off",
44+
"@typescript-eslint/ban-types": "off",
45+
"@typescript-eslint/no-explicit-any": "off",
46+
"@typescript-eslint/no-inferrable-types": "off",
47+
"@typescript-eslint/no-unused-vars": "off"
48+
}
49+
}

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
run: npm clean-install --no-optional
1919

2020
- name: Lint Project
21-
run: npx tslint --project tsconfig.json
21+
run: npm run lint

.vscode/tasks.json

+18
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@
2828
"problemMatcher": "$tsc-watch",
2929
// that's our build
3030
"group": "build"
31+
},
32+
{
33+
"label": "npm:lint",
34+
"detail": "Lint (ESLint) Project",
35+
"type": "shell",
36+
"command": "npm",
37+
"group": "build",
38+
"args": ["run", "lint"],
39+
"problemMatcher": "$eslint-compact"
40+
},
41+
{
42+
"label": "npm:lint-fix",
43+
"detail": "Lint Project with Auto-fix",
44+
"type": "shell",
45+
"command": "npm",
46+
"group": "build",
47+
"args": ["run", "lint-and-fix"],
48+
"problemMatcher": "$eslint-compact"
3149
}
3250
]
3351
}

0 commit comments

Comments
 (0)