Skip to content

Comments

Remove support for non-default typescript settings#1357

Closed
Zaczero wants to merge 1 commit intobufbuild:mainfrom
Zaczero:zaczero/broad-silkworm
Closed

Remove support for non-default typescript settings#1357
Zaczero wants to merge 1 commit intobufbuild:mainfrom
Zaczero:zaczero/broad-silkworm

Conversation

@Zaczero
Copy link

@Zaczero Zaczero commented Feb 5, 2026

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!

@timostamm
Copy link
Member

To clarify: We only support the standard compiler settings, emitted by tsc --init.

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 timostamm closed this Feb 6, 2026
@Zaczero
Copy link
Author

Zaczero commented Feb 6, 2026

@timostamm The clarification still doesn't make sense.

Both are present by default in tsc --init.

{
  // 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.

@timostamm
Copy link
Member

If this is the default config that tsc emits, it has changed behavior recently-ish, and we should re-evaluate the situation.

Can you file an issue with details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants