Skip to content

chore: share the type-checking strictness through a base tsconfig - #556

Merged
tbouffard merged 1 commit into
mainfrom
chore/shared_base_tsconfig
Aug 20, 2026
Merged

tbouffard merged 1 commit into
mainfrom
chore/shared_base_tsconfig

Conversation

@tbouffard

Copy link
Copy Markdown
Member

Problem

strict was repeated in all four TypeScript configurations, and two further strictness flags, forceConsistentCasingInFileNames and noImplicitOverride, existed in packages/addons only. Nothing kept them aligned, so a package could quietly relax its type checking and no one would notice.

Fix

Add tsconfig.base.json at the repository root and extend it from packages/addons, packages/demo, packages/check-ts-support and tsconfig.eslint.json.

It carries only what must not differ between packages:

{
  "compilerOptions": {
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitOverride": true
  }
}

Everything else deliberately stays local, and the file records why, so the next person does not have to guess whether an option was forgotten or excluded:

  • target, module, lib and moduleResolution differ because the packages have different jobs: a published library, a bundled demo, and a compatibility check that mimics a minimal consumer.
  • skipLibCheck is false where third-party types must be validated (addons, check-ts-support) and true where they are known to be noisy (demo, and the addons test config).
  • Emit options (declaration, outDir, stripInternal, noEmit) belong to whichever package emits.

Not only deduplication

forceConsistentCasingInFileNames and noImplicitOverride are new for demo, check-ts-support and the ESLint configuration. Nothing had to be changed to satisfy them.

Verification

Everything passes unchanged: addons build, addons test-check, 107 tests, demo build, check-ts-support on TypeScript 4.5.2, and the repository-wide lint.

Two checks that the inheritance actually takes effect rather than being silently ignored, both run in check-ts-support, the package with the oldest compiler and therefore the most likely to misbehave:

  • tsc --showConfig reports strict, forceConsistentCasingInFileNames and noImplicitOverride as inherited, while its local skipLibCheck: false and target survive.
  • A class overriding a method without the override modifier now fails there with TS4114, which it would not have before this change. The probe file was removed afterwards.

Part of the follow-up list of #552, where it is the last remaining tooling item.

`strict` was repeated in all four TypeScript configurations, and two further strictness flags existed in `addons`
only. Nothing kept them aligned, so a package could silently relax its checking, which is how the packages drift
apart.

Add `tsconfig.base.json` at the root and extend it everywhere, including from `tsconfig.eslint.json`. It carries only
what must not differ: `strict`, `forceConsistentCasingInFileNames` and `noImplicitOverride`.

Everything else stays local, and the file says why rather than leaving the next reader to wonder. `target`, `module`,
`lib` and `moduleResolution` differ because the packages have different jobs: a published library, a bundled demo, and
a compatibility check that mimics a minimal consumer. `skipLibCheck` is false where third-party types must be
validated and true where they are known to be noisy. Emit options belong to whichever package emits.

The two hoisted flags are new for `demo`, `check-ts-support` and the ESLint configuration, so this is not only
deduplication. Nothing had to be fixed to satisfy them: the addons build, the addons test type-check, the 107 tests,
the demo build, `check-ts-support` on TypeScript 4.5.2 and the repository lint all pass unchanged.

Verified that the inheritance is effective rather than silently ignored: `tsc --showConfig` in `check-ts-support`
reports the three inherited flags while its local `skipLibCheck: false` and `target` survive, and a class overriding a
method without the `override` modifier now fails there with TS4114, which it would not have before.
@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Aug 20, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 20, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@tbouffard
tbouffard merged commit 9d46cb9 into main Aug 20, 2026
10 checks passed
@tbouffard
tbouffard deleted the chore/shared_base_tsconfig branch August 20, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant