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 24, 2023
1 parent c2a7af1 commit 2cead4f
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 2cead4f

Please sign in to comment.