Skip to content

Commit 8fa60e3

Browse files
authored
chore: migrate from tslint to eslint (#835)
* Migrate from tslint to eslint. * Increasing eslint checks and fixing errors * Prettier change. * Remove client.waitForEvent('initialized') as client.launch({ program }) should now contain that
1 parent 3bf38d0 commit 8fa60e3

22 files changed

+2207
-670
lines changed

.eslintrc.js

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
module.exports = {
15+
"env": {
16+
"browser": true,
17+
"es6": true,
18+
"node": true
19+
},
20+
"parser": "@typescript-eslint/parser",
21+
"parserOptions": {
22+
"project": "tsconfig.json",
23+
"sourceType": "module"
24+
},
25+
"extends": [
26+
'eslint:recommended',
27+
//'plugin:jsdoc/recommended',
28+
'plugin:@typescript-eslint/eslint-recommended',
29+
'plugin:@typescript-eslint/recommended',
30+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
31+
'prettier',
32+
/*
33+
'plugin:react/recommended',
34+
'plugin:@typescript-eslint/eslint-recommended',
35+
'plugin:@typescript-eslint/recommended',
36+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
37+
'prettier',
38+
'prettier/@typescript-eslint',
39+
'plugin:import/errors',
40+
'plugin:import/warnings',
41+
'plugin:import/typescript',
42+
'plugin:unicorn/recommended',
43+
'plugin:jest-dom/recommended',
44+
'plugin:jsx-a11y/recommended',
45+
*/
46+
],
47+
"plugins": [
48+
"eslint-plugin-jsdoc",
49+
"@typescript-eslint"
50+
],
51+
"root": true,
52+
"rules": {
53+
'@typescript-eslint/no-unused-vars': [
54+
'warn',
55+
{
56+
varsIgnorePattern: '.*', // TS already enforces this
57+
args: 'none',
58+
ignoreRestSiblings: true,
59+
},
60+
],
61+
'no-unused-vars': 'off',
62+
'unused-imports/no-unused-vars': 'off',
63+
'no-constant-condition': ['error', { checkLoops: false }],
64+
'no-dupe-class-members': 'off',
65+
'no-redeclare': 'off',
66+
'prefer-rest-params': 'off',
67+
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
68+
'@typescript-eslint/no-non-null-assertion': 'off',
69+
/*
70+
"@typescript-eslint/indent": "off",
71+
"@typescript-eslint/member-delimiter-style": [
72+
"off",
73+
{
74+
"multiline": {
75+
"delimiter": "none",
76+
"requireLast": true
77+
},
78+
"singleline": {
79+
"delimiter": "semi",
80+
"requireLast": false
81+
}
82+
}
83+
],
84+
'@typescript-eslint/naming-convention': [
85+
'off',
86+
{
87+
// Properties and destructured variables often can't be controlled by us if the API is external.
88+
// Event logging, `__typename` etc don't follow conventions enforceable here.
89+
// We also need to allow implementing external interface methods, e.g. UNSAFE_componentWillReceiveProps().
90+
selector: 'default',
91+
format: null,
92+
},
93+
{
94+
// Helps e.g. Go engineers who are used to lowercase unexported types.
95+
selector: 'typeLike',
96+
format: ['PascalCase'],
97+
leadingUnderscore: 'allow',
98+
trailingUnderscore: 'allow',
99+
},
100+
],
101+
"@typescript-eslint/no-empty-function": "error",
102+
"@typescript-eslint/no-unused-expressions": "error",
103+
"@typescript-eslint/prefer-namespace-keyword": "error",
104+
"@typescript-eslint/quotes": "off",
105+
"@typescript-eslint/semi": [
106+
"off",
107+
null
108+
],
109+
"@typescript-eslint/type-annotation-spacing": "off",
110+
"arrow-parens": [
111+
"off",
112+
"always"
113+
],
114+
"brace-style": [
115+
"off",
116+
"off"
117+
],
118+
"comma-dangle": "off",
119+
"curly": "error",
120+
"eol-last": "off",
121+
"eqeqeq": [
122+
"error",
123+
"smart"
124+
],
125+
"id-denylist": [
126+
"error",
127+
"any",
128+
"Number",
129+
"number",
130+
"String",
131+
"string",
132+
"Boolean",
133+
"boolean",
134+
"Undefined",
135+
"undefined"
136+
],
137+
"id-match": "error",
138+
"indent": "off",
139+
"jsdoc/check-alignment": "error",
140+
"jsdoc/check-indentation": "error",
141+
"jsdoc/newline-after-description": "error",
142+
"linebreak-style": "off",
143+
"max-len": "off",
144+
"new-parens": "off",
145+
"newline-per-chained-call": "off",
146+
"no-empty": "error",
147+
"no-empty-function": "off",
148+
"no-eval": "error",
149+
"no-extra-semi": "off",
150+
"no-irregular-whitespace": "off",
151+
"no-multiple-empty-lines": "off",
152+
"no-redeclare": "error",
153+
"no-trailing-spaces": "off",
154+
"no-underscore-dangle": "off",
155+
"no-unused-expressions": "off",
156+
"no-var": "error",
157+
"one-var": [
158+
"error",
159+
"never"
160+
],
161+
"padded-blocks": [
162+
"off",
163+
{
164+
"blocks": "never"
165+
},
166+
{
167+
"allowSingleLineBlocks": true
168+
}
169+
],
170+
"quote-props": "off",
171+
"quotes": "off",
172+
"semi": "off",
173+
"space-before-function-paren": "off",
174+
"space-in-parens": [
175+
"off",
176+
"never"
177+
],
178+
"spaced-comment": [
179+
"error",
180+
"always",
181+
{
182+
"markers": [
183+
"/"
184+
]
185+
}
186+
]
187+
*/
188+
}
189+
};

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Prettier
3838
run: npm run prettier-check
3939
- name: Lint
40-
run: npm run tslint
40+
run: npm run eslint
4141
- name: Build VS Code extension
4242
run: npm run build
4343
- name: Setup PHP

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"out": true // set this to false to include "out" folder in search results
55
},
66
"javascript.validate.enable": false,
7-
"eslint.enable": false,
87
"editor.insertSpaces": true,
98
"editor.tabSize": 4,
10-
"tslint.ignoreDefinitionFiles": true,
119
"typescript.tsdk": "./node_modules/typescript/lib"
1210
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"script": "lint",
2828
"problemMatcher": ["$eslint-stylish"],
2929
"label": "npm: lint",
30-
"detail": "npm run tslint && npm run prettier"
30+
"detail": "npm run eslint && npm run prettier"
3131
},
3232
{
3333
"type": "npm",

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ISSUE_TEMPLATE.md
2222
package-lock.json
2323
travis-php.ini
2424
tsconfig.json
25-
tslint.json
25+
.eslintrc.js
2626
renovate.json
2727
.github
2828
codecov.yml

0 commit comments

Comments
 (0)