Skip to content

Commit 41e25fb

Browse files
committed
npm run lint: handle Jest correctly
The convention for Jest-based test scripts is to use implicit imports; ESLint needs to be told about that specifically. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 9e00a3e commit 41e25fb

4 files changed

Lines changed: 589 additions & 4 deletions

File tree

.eslintrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
22
"env": {
33
"node": true,
4-
"es6": true
4+
"es6": true,
5+
"jest/globals": true
56
},
67
"extends": "eslint:recommended",
78
"parserOptions": {
89
"ecmaVersion": 12,
910
"sourceType": "module"
1011
},
12+
"plugins": [
13+
"jest"
14+
],
1115
"rules": {
1216
"indent": ["error", 4],
1317
"no-trailing-spaces": "error"

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
check:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: install ESLint
10-
run: npm install -g eslint
119
- uses: actions/checkout@v3
10+
- name: npm install
11+
run: npm install
1212
- name: run ESLint
13-
run: eslint -c .eslintrc.json '**/*.js'
13+
run: npm run lint

0 commit comments

Comments
 (0)