Skip to content

Commit 98c0a8c

Browse files
authored
Switch from tslint to eslint (#10)
1 parent 74c6978 commit 98c0a8c

File tree

7 files changed

+1071
-200
lines changed

7 files changed

+1071
-200
lines changed

.eslintrc.js

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
module.exports = {
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"parser": "@typescript-eslint/parser",
7+
"parserOptions": {
8+
"project": "tsconfig.json",
9+
"sourceType": "module"
10+
},
11+
"plugins": [
12+
"@typescript-eslint",
13+
"@typescript-eslint/tslint"
14+
],
15+
"rules": {
16+
"@typescript-eslint/member-delimiter-style": [
17+
"warn",
18+
{
19+
"multiline": {
20+
"delimiter": "semi",
21+
"requireLast": true
22+
},
23+
"singleline": {
24+
"delimiter": "semi",
25+
"requireLast": false
26+
}
27+
}
28+
],
29+
"@typescript-eslint/prefer-for-of": "error",
30+
"@typescript-eslint/semi": [
31+
"warn",
32+
"always"
33+
],
34+
"@typescript-eslint/type-annotation-spacing": "warn",
35+
"arrow-parens": [
36+
"warn",
37+
"always"
38+
],
39+
"camelcase": "error",
40+
"curly": [
41+
"error"
42+
],
43+
"eqeqeq": [
44+
"error",
45+
"always"
46+
],
47+
"id-match": "error",
48+
"no-debugger": "error",
49+
"no-multiple-empty-lines": "warn",
50+
"no-trailing-spaces": "warn",
51+
"no-underscore-dangle": "warn",
52+
"no-var": "error",
53+
"prefer-const": "error",
54+
"prefer-template": "off",
55+
"quote-props": [
56+
"error",
57+
"as-needed"
58+
],
59+
"spaced-comment": "warn",
60+
"@typescript-eslint/tslint/config": [
61+
"warn",
62+
{
63+
"rules": {
64+
"encoding": true,
65+
"no-boolean-literal-compare": true,
66+
"no-unused-variable": true,
67+
"switch-final-break": [
68+
true,
69+
"always"
70+
],
71+
"whitespace": [
72+
true,
73+
"check-branch",
74+
"check-decl",
75+
"check-module",
76+
"check-separator",
77+
"check-type",
78+
"check-preblock"
79+
],
80+
"prefer-template": [
81+
true,
82+
"allow-single-concat"
83+
]
84+
}
85+
}
86+
]
87+
}
88+
};

.vscode/extensions.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"eg2.tslint"
5+
"eg2.tslint",
6+
"dbaeumer.vscode-eslint"
67
]
7-
}
8+
}

.vscode/tasks.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"kind": "build",
1616
"isDefault": true
1717
}
18+
},
19+
{
20+
"type": "npm",
21+
"script": "lint",
22+
"problemMatcher": "$eslint-stylish"
1823
}
1924
]
20-
}
25+
}

0 commit comments

Comments
 (0)