Remove support for non-default typescript settings#1357
Remove support for non-default typescript settings#1357Zaczero wants to merge 1 commit intobufbuild:mainfrom
Conversation
|
To clarify: We only support the standard compiler settings, emitted by This PR introduces at least one major breaking change without without any apparent benefit and cannot be accepted. If this was a sincere attempt to improve the project, I encourage you to become a bit more familiar with it first. |
|
@timostamm The clarification still doesn't make sense. Both are present by default in {
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
// File Layout
// "rootDir": "./src",
// "outDir": "./dist",
// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "nodenext",
"target": "esnext",
"types": [],
// For nodejs:
// "lib": ["esnext"],
// "types": ["node"],
// and npm install -D @types/node
// Other Outputs
"sourceMap": true,
"declaration": true,
"declarationMap": true,
// Stricter Typechecking Options
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
// Style Options
// "noImplicitReturns": true,
// "noImplicitOverride": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
// "noPropertyAccessFromIndexSignature": true,
// Recommended Options
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
}
}I understand that the union with undefined is somewhat inelegant. However, misusing the optional operator is simply a typing bug, and now the library is becoming opinionated instead of following recommended best practices. |
|
If this is the default config that Can you file an issue with details? |
Succeeds #1347
I agree with @timostamm and @smaye81 that we should not put effort into supporting non-default TypeScript features. Having said that, I noticed huge potential in removing redundant code that was there to make it "strict"-friendlier. This avoids a huge bug surface and typing misuse which the previous PR was trying to fix. So we get less code, and fewer bugs, and easier maintenance. Win-win-win!
https://www.typescriptlang.org/docs/handbook/compiler-options.html#strict-boolean-default-false
I'll soon do a broader sweep to remove unnecessary code, but this seems like a good first quick win!