Skip to content

Commit 13ab01f

Browse files
committed
replace tslint with eslint
1 parent a1af78a commit 13ab01f

File tree

10 files changed

+567
-273
lines changed

10 files changed

+567
-273
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
"dependencies": {
33
},
44
"devDependencies": {
5+
"@typescript-eslint/eslint-plugin": "^2.27.0",
6+
"@typescript-eslint/parser": "^2.27.0",
57
"bash-language-server": "^1.6.1",
68
"dockerfile-language-server-nodejs": "^0.0.22",
7-
"eslint": "^5.16.0",
8-
"eslint-config-prettier": "^4.1.0",
9-
"eslint-plugin-prettier": "^3.0.1",
9+
"eslint-config-prettier": "^6.7.0",
10+
"eslint-plugin-jest": "^23.8.2",
11+
"eslint-plugin-prettier": "^3.1.1",
12+
"eslint-plugin-react": "^7.19.0",
13+
"eslint": "^6.8.0",
1014
"husky": "^3.0.9",
1115
"javascript-typescript-langserver": "^2.11.3",
1216
"lerna": "^3.13.2",
1317
"precise-commits": "^1.0.2",
1418
"prettier": "^2.0.5",
15-
"tslint-config-prettier": "^1.18.0",
16-
"tslint-plugin-prettier": "^2.0.1",
17-
"tslint-react": "^4.0.0",
18-
"tslint": "^5.15.0",
1919
"typescript": "~3.9.5",
2020
"unified-language-server": "^0.3.0",
2121
"vscode-css-languageserver-bin": "^1.4.0",
@@ -42,13 +42,13 @@
4242
"bundle": "lerna run --parallel bundle",
4343
"clean": "lerna run --parallel clean",
4444
"lab:link": "lerna run lab:link",
45-
"lint:check": "jlpm prettier:check && jlpm tslint:check",
46-
"lint": "jlpm prettier && jlpm tslint",
45+
"lint:check": "jlpm prettier:check && jlpm eslint:check",
46+
"lint": "jlpm prettier && jlpm eslint",
4747
"prettier:check": "prettier --check '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
48-
"test": "lerna run --stream --concurrency=1 test",
4948
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
50-
"tslint": "tslint --fix -c ./packages/tslint.json --project ./packages/tsconfigbase.json 'packages/**/*{.ts,.tsx}'",
51-
"tslint:check": "tslint -c ./packages/tslint.json --project ./packages/tsconfigbase.json 'packages/**/*{.ts,.tsx}'"
49+
"eslint": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx --fix packages",
50+
"eslint:check": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx packages",
51+
"test": "lerna run --stream --concurrency=1 test"
5252
},
5353
"workspaces": {
5454
"packages": [

packages/.eslintrc.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
commonjs: true,
6+
node: true,
7+
'jest/globals': true,
8+
},
9+
root: true,
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:@typescript-eslint/eslint-recommended',
13+
'plugin:@typescript-eslint/recommended',
14+
'prettier/@typescript-eslint',
15+
'plugin:react/recommended',
16+
'plugin:jest/recommended',
17+
],
18+
ignorePatterns: [
19+
'**/node_modules/**/*',
20+
'**/lib/**/*',
21+
'**/_*.ts',
22+
'**/_*.d.ts',
23+
'**/typings/**/*.d.ts',
24+
],
25+
parser: '@typescript-eslint/parser',
26+
parserOptions: {
27+
project: 'packages/tsconfig.eslint.json',
28+
},
29+
plugins: ['@typescript-eslint', 'jest'],
30+
rules: {
31+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
32+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
33+
'@typescript-eslint/no-use-before-define': 'off',
34+
'@typescript-eslint/camelcase': 'off',
35+
'@typescript-eslint/no-explicit-any': 'off',
36+
'@typescript-eslint/no-non-null-assertion': 'off',
37+
'@typescript-eslint/no-namespace': 'off',
38+
'@typescript-eslint/explicit-function-return-type': 'off',
39+
'@typescript-eslint/ban-ts-ignore': 'warn',
40+
'@typescript-eslint/no-var-requires': 'off',
41+
'@typescript-eslint/no-empty-interface': 'off',
42+
'@typescript-eslint/no-inferrable-types': 'off',
43+
'no-inner-declarations': 'off',
44+
'no-prototype-builtins': 'off',
45+
'no-control-regex': 'warn',
46+
'no-undef': 'warn',
47+
'no-case-declarations': 'warn',
48+
'no-useless-escape': 'off',
49+
'prefer-const': 'off',
50+
'jest/no-jest-import': 'off',
51+
'jest/no-export': 'warn',
52+
'jest/no-try-expect': 'warn',
53+
'jest/expect-expect': 'off',
54+
// deviations from jupyterlab, should probably be fixed
55+
'jest/valid-expect': 'off',
56+
'jest/no-test-callback': 'off',
57+
'@typescript-eslint/ban-ts-ignore': 'off',
58+
'@typescript-eslint/interface-name-prefix': 'off',
59+
'react/display-name': 'off',
60+
'prefer-spread': 'off',
61+
'@typescript-eslint/triple-slash-reference': 'off',
62+
'no-async-promise-executor': 'off',
63+
},
64+
settings: {
65+
react: {
66+
version: 'detect',
67+
},
68+
},
69+
};

packages/jupyterlab-go-to-definition/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let local = {
2020
transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'],
2121
};
2222

23-
for (option of reuseFromUpstream) {
23+
for (const option of reuseFromUpstream) {
2424
local[option] = upstream[option];
2525
}
2626

packages/jupyterlab-lsp/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let local = {
2121
transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'],
2222
};
2323

24-
for (option of reuseFromUpstream) {
24+
for (const option of reuseFromUpstream) {
2525
local[option] = upstream[option];
2626
}
2727

packages/jupyterlab-lsp/src/adapters/jupyterlab/components/statusbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ class LSPPopup extends VDomRenderer<LSPStatus.Model> {
215215
href={
216216
'https://github.com/krassowski/jupyterlab-lsp/blob/master/docs/LANGUAGESERVERS.md'
217217
}
218-
target={'_blank'}
218+
target="_blank"
219+
rel="noreferrer"
219220
>
220221
Language Servers
221222
</a>

packages/jupyterlab-lsp/src/virtual/editor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,4 @@ export abstract class VirtualEditor implements CodeMirror.Editor {
253253
}
254254
}
255255

256-
// tslint:disable-next-line:interface-name
257256
export interface VirtualEditor extends CodeMirror.Editor {}

packages/lsp-ws-connection/src/ws-connection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class LspWsConnection extends events.EventEmitter
342342
if (!this.isReady) {
343343
return;
344344
}
345-
this.connection
345+
void this.connection
346346
.sendRequest<protocol.CompletionItem>(
347347
'completionItem/resolve',
348348
completionItem
@@ -504,7 +504,7 @@ export class LspWsConnection extends events.EventEmitter
504504
return;
505505
}
506506

507-
this.connection
507+
void this.connection
508508
.sendRequest<Location | Location[] | LocationLink[]>(
509509
'textDocument/implementation',
510510
{

packages/tsconfig.eslint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfigbase",
3+
"include": ["**/*"]
4+
}

packages/tslint.json

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)