Skip to content

Commit 21540b4

Browse files
nickservtimdorr
authored andcommitted
TypeScript: Fix linter configuration for test files (reduxjs#3518)
* Fix linter configuration for test files * Add separate ESLint config to test/typescript * Also lint TypeScript files in examples Former-commit-id: 27bf970
1 parent 0a52d4f commit 21540b4

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

.eslintrc.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,5 @@ module.exports = {
3030
argsIgnorePattern: '^_' // ignore unused variables whose name is '_'
3131
}
3232
]
33-
},
34-
35-
overrides: [
36-
{
37-
files: 'test/**/*.js',
38-
env: {
39-
jest: true
40-
}
41-
}
42-
]
33+
}
4334
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
"clean": "rimraf lib dist es coverage",
3939
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
4040
"format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
41-
"lint": "eslint src test",
41+
"lint": "eslint --ext js,ts src test",
4242
"pretest": "npm run build",
4343
"test": "jest",
4444
"test:watch": "npm test -- --watch",
4545
"test:cov": "npm test -- --coverage",
4646
"build": "rollup -c",
4747
"prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
4848
"check-types": "tsc",
49-
"examples:lint": "eslint examples",
49+
"examples:lint": "eslint --ext js,ts examples",
5050
"examples:test": "cross-env CI=true babel-node examples/testAll.js"
5151
},
5252
"dependencies": {

test/typescript/.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
rules: {
3+
'no-unused-expressions': 'off',
4+
'@typescript-eslint/no-namespace': 'off',
5+
'@typescript-eslint/no-unused-vars': 'off'
6+
}
7+
}

0 commit comments

Comments
 (0)