Create unified tsconfig preset #199
Unanswered
remcohaszing
asked this question in
Ideas
Replies: 1 comment 2 replies
-
|
Yeah, I’m in favor
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Across unified projects a similar
tsconfig.jsonis used with very similar settings.It might be nice to have a preset to extend from. This preset can also define some options that are often forgotten.
{ // Maybe add "build" and "dist" too? "exclude": ["coverage", "node_modules"], "compilerOptions": { "checkJs": true, "declaration": true, "emitDeclarationOnly": true, // Missing in many projects (recommended by TypeScript docs) "exactOptionalPropertyTypes": true, // Missing in many projects (recommended by TypeScript docs) "forceConsistentCasingInFileNames": true, "lib": ["es2020"], "module": "node16", // Default is platform specific, which is weird to me. "newLine": "lf", "skipLibCheck": true, "strict": true, "target": "es2020" } }Some options are deliberately omitted.
"moduleResolution": "node16"is implied if"module": "node16""allowSyntheticDefaultImports": trueis implied if"module": "node16""allowJs": trueis implied if"checkJs": true"skipLibCheck": truealthough recommended by the TypeScript handbook, I think it’s a bad idea for libraries, because it hides type errors that cause type errors for dependants, meaning they are also forced to useskipLibCheck.Now unified projects just have to use the following
tsconfig.json:{ "extends": "unified-tsconfig" }Options can still be overridden.
Beta Was this translation helpful? Give feedback.
All reactions