diff --git a/packages/create-react-native-library/templates/common/$package.json b/packages/create-react-native-library/templates/common/$package.json index f67a58f28..8315a7c0b 100644 --- a/packages/create-react-native-library/templates/common/$package.json +++ b/packages/create-react-native-library/templates/common/$package.json @@ -36,7 +36,7 @@ "example": "yarn workspace <%- project.slug -%>-example", <% } -%> "test": "jest", - "typecheck": "tsc --noEmit", + "typecheck": "tsc", "lint": "eslint \"**/*.{js,ts,tsx}\"", <% if (example !== 'expo') { -%> "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", diff --git a/packages/create-react-native-library/templates/common/lefthook.yml b/packages/create-react-native-library/templates/common/lefthook.yml index b22aaa72b..9695c1295 100644 --- a/packages/create-react-native-library/templates/common/lefthook.yml +++ b/packages/create-react-native-library/templates/common/lefthook.yml @@ -6,7 +6,7 @@ pre-commit: run: npx eslint {staged_files} types: glob: "*.{js,ts, jsx, tsx}" - run: npx tsc --noEmit + run: npx tsc commit-msg: parallel: true commands: diff --git a/packages/create-react-native-library/templates/common/tsconfig.json b/packages/create-react-native-library/templates/common/tsconfig.json index 7472abcad..4bd3523b3 100644 --- a/packages/create-react-native-library/templates/common/tsconfig.json +++ b/packages/create-react-native-library/templates/common/tsconfig.json @@ -12,6 +12,7 @@ "lib": ["ESNext"], "module": "ESNext", "moduleResolution": "Bundler", + "noEmit": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "noImplicitUseStrict": false, diff --git a/packages/react-native-builder-bob/src/targets/typescript.ts b/packages/react-native-builder-bob/src/targets/typescript.ts index 9d2d9e1a7..5cef25777 100644 --- a/packages/react-native-builder-bob/src/targets/typescript.ts +++ b/packages/react-native-builder-bob/src/targets/typescript.ts @@ -38,14 +38,6 @@ export default async function build({ if (config.compilerOptions) { const conflicts: string[] = []; - if (config.compilerOptions.noEmit !== undefined) { - conflicts.push('compilerOptions.noEmit'); - } - - if (config.compilerOptions.emitDeclarationOnly !== undefined) { - conflicts.push('compilerOptions.emitDeclarationOnly'); - } - if (config.compilerOptions.declarationDir) { conflicts.push('compilerOptions.declarationDir'); } @@ -170,6 +162,8 @@ export default async function build({ '--pretty', '--declaration', '--declarationMap', + '--noEmit', + 'false', '--emitDeclarationOnly', '--project', project,