Skip to content

Commit

Permalink
Fix noFallthroughCasesInSwitch/jsx object is not extensible (facebook…
Browse files Browse the repository at this point in the history
…#9921)

Co-authored-by: Konstantin Simeonov <kon.simeonov@protonmail.com>
  • Loading branch information
2 people authored and wombleton committed Jun 1, 2021
1 parent e9c4a43 commit 22164e1
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 22164e1

Please sign in to comment.