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 abhiisheek committed May 19, 2023
1 parent 4e38857 commit 5c21b7a
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 5c21b7a

Please sign in to comment.