4 Commits
Author SHA1 Message Date
musi 3d6e5dab42 Merge pull request #1771 from ntdatt812/fix/tsconfig-node-project-inputs
fix(tsconfig): give the node project inputs it can actually have
2026-09-16 19:34:42 +08:00
Nguyen Thanh Dat 199b4391e2 fix(tsconfig): give the node project inputs it can actually have
`tsc -b` fails before it builds anything:

  error TS18003: No inputs were found in config file 'tsconfig.node.json'.
  Specified 'include' paths were '["build/**/*.mjs"]' and 'exclude' paths
  were '[]'.

Editors report the same error against the file directly, which is where it
is usually met.

The include names ten files that exist, but TypeScript only takes `.mjs`
as an input when `allowJs` is on, and it is not. So the referenced project
has no inputs and cannot have any, which a composite project may not.

`allowJs` is not the fix. Turning it on with `checkJs` surfaces 20 errors
in build scripts nobody asked TypeScript to check, and turning it on
without `checkJs` only produces declarations for build tooling. Either is
a policy change, not a repair.

`build/` has never held a `.ts` file. What the root config does not cover
is `playwright.config.ts` -- its include is `packages/*/src/**` and
`tests/e2e/**` -- and a node-side config file is what a `tsconfig.node.json`
exists for. Pointing the include there gives the project real inputs and
type-checks a file that was unchecked.

Composite implies declaration emit, so the output goes to `.tmp/`, which is
already ignored, instead of dropping `playwright.config.js` and a `.d.ts`
next to the source.

`npm run typecheck` is unaffected: it runs `tsc --noEmit`, which never
built this reference, which is why the repo has been green with it broken.
2026-09-08 08:14:22 +07:00
Nguyen Thanh Dat 89f160c381 chore(tsconfig): drop baseUrl so the configs survive TypeScript 7
TypeScript 6 reports it as an error:

  Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
  Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

The repo pins typescript 5.9.3, so the current typecheck is quiet, but an
editor running a newer TypeScript flags it, and it becomes a hard failure
whenever the pin moves to 7.

In both configs baseUrl only anchors `paths`, and `paths` has not needed
it since TypeScript 4.4 — entries resolve relative to the tsconfig that
declares them. Every path here is already written relatively
("./packages/…", "./src/*"), so removing the line is the whole change.

Chose this over `"ignoreDeprecations": "6.0"`: that key silences the
message for one major version and has to be revisited, while this makes
the configs correct.

Nothing relies on baseUrl for bare-specifier resolution — there are no
`from "packages/…"` or `from "src/…"` imports under packages/*/src or
tests/e2e.

Verified with the repo's own typescript:
  tsconfig.json       0 errors before, 0 after (234 files import via
                      @ccr/* or @/*, so a broken alias could not be silent)
  tsconfig.node.json  1 error before, 1 after, byte-identical output —
                      a pre-existing TS18003 (its include is
                      "build/**/*.mjs" and allowJs is off), untouched here.

Re-checked both under TypeScript 6.0.3: the deprecation is gone and no new
diagnostic replaces it.
2026-09-07 20:02:05 +07:00
musistudio 9eec586e60 init 2026-06-17 11:58:37 +08:00