Skip to content

Commit 6146cc4

Browse files
committed
Switch to ESLint
1 parent 802b711 commit 6146cc4

File tree

7 files changed

+707
-119
lines changed

7 files changed

+707
-119
lines changed

.eslintrc.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"env": { "node": true },
9+
"globals": { "Thenable": false },
10+
"plugins": ["@typescript-eslint"],
11+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
12+
"rules": {
13+
"@typescript-eslint/naming-convention": "warn",
14+
"@typescript-eslint/semi": "warn",
15+
"curly": "warn",
16+
"eqeqeq": "warn",
17+
"no-throw-literal": "warn",
18+
"semi": "off"
19+
},
20+
"ignorePatterns": ["out", "**/*.d.ts"]
21+
}

.vscode/extensions.json

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

.vscodeignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ test/**
1212
**/*.map
1313
.gitignore
1414
tsconfig.json
15-
tslint.json

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"package": "vsce package",
8383
"postinstall": "patch-package",
8484
"publish": "vsce publish",
85-
"test": "tslint -t verbose -p tsconfig.json"
85+
"test": "eslint src/*"
8686
},
8787
"dependencies": {
8888
"ungit": "1.5.6",
@@ -91,9 +91,11 @@
9191
"devDependencies": {
9292
"@types/node": "12.x.x",
9393
"@types/vscode": "1.x.x",
94+
"@typescript-eslint/eslint-plugin": "5.x.x",
95+
"@typescript-eslint/parser": "5.x.x",
96+
"eslint": "8.x.x",
9497
"patch-package": "6.x.x",
9598
"postinstall-postinstall": "2.x.x",
96-
"tslint": "6.x.x",
9799
"typescript": "3.8.x",
98100
"vsce": "2.13.x"
99101
},

src/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function openInWorkspace(workspaceFolder: WorkspaceFolder): void {
8989
child = fork(modulePath, parameter, { silent: true });
9090
const showInActiveColumn = workspace.getConfiguration("ungit", workspaceFolder.uri).get<boolean>("showInActiveColumn") === true;
9191
const viewColumn = showInActiveColumn ? ViewColumn.Active : ViewColumn.Beside;
92-
child.stdout!.on("data", (message: Buffer) => {
92+
child.stdout?.on("data", (message: Buffer) => {
9393
const started =
9494
(message.toString().includes("## Ungit started ##")) ||
9595
(message.toString().includes("Ungit server already running")) ||
@@ -110,7 +110,7 @@ function openInWorkspace(workspaceFolder: WorkspaceFolder): void {
110110
resolve();
111111
}
112112
});
113-
child.stderr!.on("error", (error) => {
113+
child.stderr?.on("error", (error) => {
114114
window.showErrorMessage(`Error opening Ungit: "${error.message}"`);
115115
telemetryReporter.sendTelemetryException(error);
116116
reject();

tslint.json

-9
This file was deleted.

0 commit comments

Comments
 (0)