From 361bc37732cb4ab521620686bc5db2f97b712d47 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Sat, 27 Apr 2019 22:39:21 -0700 Subject: [PATCH] Disable default-case lint rule for TypeScript --- packages/eslint-config-react-app/index.js | 4 ++++ packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 01b99e65351..c3782bb21be 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -69,6 +69,10 @@ module.exports = { // If adding a typescript-eslint version of an existing ESLint rule, // make sure to disable the ESLint rule here. rules: { + // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906) + 'default-case': 'off', + + // Add TypeScript specific rules (and turn off ESLint equivalents) '@typescript-eslint/no-angle-bracket-type-assertion': 'warn', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'warn', diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index 7972c4e1012..a73b8c0db3b 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -106,6 +106,8 @@ function verifyTypeScriptSetup() { allowSyntheticDefaultImports: { suggested: true }, strict: { suggested: true }, forceConsistentCasingInFileNames: { suggested: true }, + // TODO: Enable for v4.0 (#6936) + // noFallthroughCasesInSwitch: { suggested: true }, // These values are required and cannot be changed by the user // Keep this in sync with the webpack config @@ -181,7 +183,7 @@ function verifyTypeScriptSetup() { ) ); } - + console.log(e && e.message ? `${e.message}` : ''); process.exit(1); }