Skip to content

Commit 306b9e9

Browse files
Fail the build if there are eslint errors/warnings
1 parent 4fd2d44 commit 306b9e9

File tree

7 files changed

+40
-13
lines changed

7 files changed

+40
-13
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/**
22
client/node_modules/**
33
client/out/**
44
server/node_modules/**
5-
server/out/**
5+
server/out/**
6+
server/src/fbuild-grammar.ts

.github/workflows/node.js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
cache: 'npm'
2929
- run: npm clean-install
3030
- run: npm run build-grammar
31+
- run: npm run lint
3132
- run: npm run build
3233
- run: npm test
3334
- name: Publish

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"editor.insertSpaces": false,
3-
"tslint.enable": true,
43
"typescript.tsc.autoDetect": "off",
54
"typescript.preferences.quoteStyle": "single",
65
"editor.codeActionsOnSave": {
@@ -9,4 +8,4 @@
98
"search.exclude": {
109
"**/out": true
1110
}
12-
}
11+
}

.vscode/tasks.json

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,37 @@
1111
},
1212
"presentation": {
1313
"panel": "dedicated",
14-
"reveal": "never"
14+
"reveal": "silent",
15+
"revealProblems": "onProblem",
16+
"clear": true
1517
},
1618
"problemMatcher": [
1719
"$tsc"
1820
],
1921
"dependsOn": [
22+
"lint",
2023
"build grammar"
2124
]
2225
},
26+
{
27+
"label": "lint",
28+
"type": "npm",
29+
"script": "lint",
30+
"group": {
31+
"kind": "build",
32+
"isDefault": false
33+
},
34+
"presentation": {
35+
"panel": "dedicated",
36+
"reveal": "silent",
37+
"revealProblems": "onProblem",
38+
"clear": true
39+
},
40+
"problemMatcher": [
41+
"$tsc"
42+
],
43+
"dependsOn": []
44+
},
2345
{
2446
"label": "watch-build",
2547
"type": "npm",
@@ -28,12 +50,15 @@
2850
"group": "build",
2951
"presentation": {
3052
"panel": "dedicated",
31-
"reveal": "never"
53+
"reveal": "silent",
54+
"revealProblems": "onProblem",
55+
"clear": true
3256
},
3357
"problemMatcher": [
3458
"$tsc-watch"
3559
],
3660
"dependsOn": [
61+
"lint",
3762
"build grammar"
3863
]
3964
},
@@ -52,6 +77,8 @@
5277
"isDefault": true
5378
},
5479
"presentation": {
80+
"reveal": "always",
81+
"revealProblems": "onProblem",
5582
"clear": true
5683
},
5784
"dependsOn": "build"
@@ -64,7 +91,9 @@
6491
"isBackground": true,
6592
"presentation": {
6693
"panel": "dedicated",
67-
"reveal": "silent"
94+
"reveal": "silent",
95+
"revealProblems": "onProblem",
96+
"clear": true
6897
},
6998
"dependsOn": "watch-build"
7099
},
@@ -80,4 +109,4 @@
80109
"problemMatcher": []
81110
}
82111
]
83-
}
112+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
},
7171
"scripts": {
7272
"build-grammar": "node server/node_modules/nearley/bin/nearleyc.js server/src/fbuild-grammar.ne --out server/src/fbuild-grammar.ts",
73+
"lint": "node ./node_modules/eslint/bin/eslint.js . --max-warnings 0",
7374
"build": "tsc --build",
7475
"watch-build": "tsc --build --watch",
7576
"postinstall": "cd client && npm install && cd ../server && npm install && cd ..",

server/src/features/definitionProvider.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import {
33
DefinitionParams,
44
} from 'vscode-languageserver-protocol';
55

6-
import {
7-
DocumentUri,
8-
} from 'vscode-languageserver-types';
9-
106
import {
117
isPositionInRange,
128
} from '../parser';
@@ -40,4 +36,4 @@ export class DefinitionProvider {
4036

4137
return null;
4238
}
43-
}
39+
}

server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,4 +384,4 @@ state.documents.onDidClose(change => {
384384

385385
// Make the text document manager listen on the connection for open, change and close text document events.
386386
state.documents.listen(state.connection);
387-
state.connection.listen();
387+
state.connection.listen();

0 commit comments

Comments
 (0)