Skip to content

Commit

Permalink
Fix noFallthroughCasesInSwitch/jsx object is not extensible (#9921)
Browse files Browse the repository at this point in the history
Co-authored-by: Konstantin Simeonov <kon.simeonov@protonmail.com>
  • Loading branch information
ryota-murakami and KonstantinSimeonov committed Oct 30, 2020
1 parent 545d460 commit 3a98ed1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ function verifyTypeScriptSetup() {
if (appTsConfig.compilerOptions == null) {
appTsConfig.compilerOptions = {};
firstTimeSetup = true;
} else {
// This is bug fix code of https://github.com/facebook/create-react-app/issues/9868
// Bellow code release variable from non-extensible and freeze status.
appTsConfig.compilerOptions = JSON.parse(JSON.stringify(appTsConfig.compilerOptions));

// Original appTsConfig.compilerOptions status
// Object.isExtensible(appTsConfig.compilerOptions) output: false
// Object.isFrozen(appTsConfig.compilerOptions) output: true
}

for (const option of Object.keys(compilerOptions)) {
Expand Down

0 comments on commit 3a98ed1

Please sign in to comment.