-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathtsconfig.test.json
More file actions
34 lines (34 loc) · 1.55 KB
/
Copy pathtsconfig.test.json
File metadata and controls
34 lines (34 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Type-checking config for the test suites.
//
// Kept separate from tsconfig.json on purpose: that one describes the *build*, and the
// production bundle must not be influenced by test files. This config adds `test/` and
// `integration/` on top of it purely for `svelte-check`, which never emits.
//
// Why this exists at all: `tsconfig.json`'s `include` covers only `src/**`,
// so nothing type-checked the tests. That let a call to `resolveSegments` keep passing a
// removed argument — the arguments shifted by one, the function returned [], and all four
// assertions in that suite passed vacuously for as long as it took someone to notice.
// A test that cannot fail is worse than no test, so the suites are now checked too.
{
"extends": "./tsconfig.json",
"compilerOptions": {
// svelte-check never emits; saying so lets `noEmitOnError` from the base config be
// irrelevant here rather than interacting with a check-only run.
"noEmit": true,
// The integration suites import helpers by explicit `.ts` path (e.g.
// `./helpers/cli.ts`), which Vitest resolves natively. Without this, every one of
// those imports is a TS5097 error about the extension rather than a real finding.
"allowImportingTsExtensions": true,
// Tests reach for node builtins (node:child_process, node:fs) that the plugin itself
// never uses, so the build config deliberately omits these types.
"types": ["svelte", "vite/client", "node"]
},
"include": [
"src/**/*.d.ts",
"src/**/*.ts",
"src/**/*.js",
"src/**/*.svelte",
"test/**/*.ts",
"integration/**/*.ts"
]
}