eslint switch/case exhaustiveness check rule (#739)

This commit is contained in:
Jordi Bunster 2021-05-04 09:12:54 -07:00 committed by GitHub
parent 038f3ee684
commit b7579d5c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 30532 deletions

View File

@ -1,4 +1,5 @@
**/node_modules/ **/node_modules/
src/**/__mocks__/**/*
dist/ dist/
Contracts/ Contracts/
src/Api/Apis.ts src/Api/Apis.ts

View File

@ -11,6 +11,7 @@ module.exports = {
}, },
parser: "@typescript-eslint/parser", parser: "@typescript-eslint/parser",
parserOptions: { parserOptions: {
project: ["./tsconfig.json", "./tsconfig.test.json"],
ecmaFeatures: { ecmaFeatures: {
jsx: true, jsx: true,
}, },
@ -35,6 +36,7 @@ module.exports = {
rules: { rules: {
"no-console": ["error", { allow: ["error", "warn", "dir"] }], "no-console": ["error", { allow: ["error", "warn", "dir"] }],
curly: "error", curly: "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-extraneous-class": "error", "@typescript-eslint/no-extraneous-class": "error",
"no-null/no-null": "error", "no-null/no-null": "error",

30593
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -128,8 +128,8 @@
"@types/sinon": "2.3.3", "@types/sinon": "2.3.3",
"@types/styled-components": "5.1.1", "@types/styled-components": "5.1.1",
"@types/underscore": "1.7.36", "@types/underscore": "1.7.36",
"@typescript-eslint/eslint-plugin": "4.0.1", "@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.0.1", "@typescript-eslint/parser": "4.22.0",
"babel-jest": "24.9.0", "babel-jest": "24.9.0",
"babel-loader": "8.1.0", "babel-loader": "8.1.0",
"buffer": "5.1.0", "buffer": "5.1.0",

View File

@ -21,6 +21,6 @@
"noEmit": true, "noEmit": true,
"types": ["jest"] "types": ["jest"]
}, },
"include": ["./src/**/*", "./test/testExplorer/TestExplorer.ts"], "include": ["./src/**/*", "./utils/**/*"],
"exclude": ["./src/**/__mocks__/**/*"] "exclude": ["./src/**/__mocks__/**/*"]
} }

View File

@ -1,5 +1,6 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"include": ["./test/**/*"],
"compilerOptions": { "compilerOptions": {
"module": "commonjs" "module": "commonjs"
} }