Skip to content

Commit 4397d06

Browse files
authored
Disable default-case lint rule for TypeScript (#6937)
1 parent b36d1ea commit 4397d06

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/eslint-config-react-app/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ module.exports = {
6969
// If adding a typescript-eslint version of an existing ESLint rule,
7070
// make sure to disable the ESLint rule here.
7171
rules: {
72+
// TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
73+
'default-case': 'off',
74+
75+
// Add TypeScript specific rules (and turn off ESLint equivalents)
7276
'@typescript-eslint/no-angle-bracket-type-assertion': 'warn',
7377
'no-array-constructor': 'off',
7478
'@typescript-eslint/no-array-constructor': 'warn',

packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ function verifyTypeScriptSetup() {
106106
allowSyntheticDefaultImports: { suggested: true },
107107
strict: { suggested: true },
108108
forceConsistentCasingInFileNames: { suggested: true },
109+
// TODO: Enable for v4.0 (#6936)
110+
// noFallthroughCasesInSwitch: { suggested: true },
109111

110112
// These values are required and cannot be changed by the user
111113
// Keep this in sync with the webpack config
@@ -181,7 +183,7 @@ function verifyTypeScriptSetup() {
181183
)
182184
);
183185
}
184-
186+
185187
console.log(e && e.message ? `${e.message}` : '');
186188
process.exit(1);
187189
}

0 commit comments

Comments
 (0)