Typescript config conflict 'noEmit' and 'emitDeclarationOnly' #487
-
I receive an error (see below) when building my project with tsconfig.json - error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'. This error happens because my my {
"extends": "@react-native/typescript-config/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"forceConsistentCasingInFileNames": true,
"lib": ["esnext", "dom"],
"module": "esnext",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUnusedLocals": true,
"target": "esnext"
}
} I know that I can copy code from the As a solution, Any suggestion on how to solve the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hey, you should be able to easily override the {
"extends": "@react-native/typescript-config/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"forceConsistentCasingInFileNames": true,
"lib": ["esnext", "dom"],
"module": "esnext",
"noFallthroughCasesInSwitch": true,
+ "noEmit": false,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUnusedLocals": true,
"target": "esnext"
}
} You can also use
When |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing the same issue. Tried @atlj's suggestion, but no luck. Any idea how to bypass this? tsconfig.build.json
tsconfig.json
package.json
|
Beta Was this translation helpful? Give feedback.
Hey, you should be able to easily override the
noEmit
option in yourtsconfig.json
file without changing React Native's config.{ "extends": "@react-native/typescript-config/tsconfig.json", "compilerOptions": { "baseUrl": ".", "allowUnreachableCode": false, "allowUnusedLabels": false, "forceConsistentCasingInFileNames": true, "lib": ["esnext", "dom"], "module": "esnext", "noFallthroughCasesInSwitch": true, + "noEmit": false, "noImplicitReturns": true, "noImplicitUseStrict": false, "noStrictGenericChecks": false, "noUnusedLocals": true, "target": "esnext" } }
You can also use
tsconfig.build.json
file to set this setting.tsconfig.buil…