-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.scripts.json
More file actions
72 lines (72 loc) · 3.56 KB
/
Copy pathtsconfig.scripts.json
File metadata and controls
72 lines (72 loc) · 3.56 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
// Type-check for the repository's own tooling: the gate runners, the release
// cut, the build driver, the measurement harnesses, and the root config
// files.
//
// `tsconfig.json` covers `src/**` only, so until this config existed nothing
// type-checked `scripts/**` - a rename or a changed signature surfaced when
// the script next ran, which for the release cut means during a release.
// ESLint runs over the tree but with `disableTypeChecked`, since these files
// sit outside any typed program; that catches unused symbols and import
// order, not types.
//
// These are Node programs executed through `tsx`, so they import each other
// by their real `.ts` paths rather than extensionless specifiers - hence
// `allowImportingTsExtensions` with `noEmit`. `verbatimModuleSyntax` from the
// shared base stays on: the scripts are ESM and the distinction between a
// type and a value import is the same contract here as in the engine.
//
// `@codexo/exojs-config` is plain ESM `.js` annotated with JSDoc, and it is
// in this program rather than behind an ambient `declare module`: with
// `allowJs`/`checkJs` its annotations are the real types, so a consumer that
// passes the wrong shape to a shared ESLint/Vitest/Rolldown factory fails
// here. Converting it to TypeScript is not required for that and would cost
// more than it buys - ESLint and Prettier load it directly at runtime.
//
// `scripts/**` itself is TypeScript throughout, including the files that run
// with no toolchain behind them - node strips their types itself. The `.mjs`
// include stays anyway, so a file that reappears in that form is checked
// rather than silently outside the program again.
//
// `.mts` / `.cts` are listed for the same reason, and they need listing:
// TypeScript's `*.ts` glob does not match them, so a module-variant file was
// outside this program while looking like ordinary TypeScript to a reader -
// the one shape `lint:js-files` cannot catch either, because it is not
// JavaScript.
"extends": "@codexo/exojs-config/typescript/base.json",
"compilerOptions": {
"lib": ["es2023"],
"types": ["node"],
"moduleResolution": "bundler",
// `scripts/build-container.ts` imports engine source directly, which pulls
// that file - and its `#assets/...` specifiers - into this program. Without
// the source condition those resolve through the package's `types`
// condition to `dist/esm/*.d.ts`, so the program type-checks against
// whatever build output happens to be lying around, and fails outright on a
// clean checkout that has none.
"customConditions": ["@codexo/exojs-source"],
"allowImportingTsExtensions": true,
"allowJs": true,
"checkJs": true,
"noEmit": true,
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false
},
// `exo-full.entry.ts` is a bundler entry, not a Node program: it re-exports
// every extension package and is type-checked by `tsconfig.examples.json`
// against their sources.
// `competitors/link.ts` is bench SETUP rather than bench code: it imports only
// `node:` built-ins and runs before the competitor install exists, so it
// belongs to this always-checked tooling program rather than to the bench
// package's own, which cannot be type-checked without that install.
"include": [
"scripts/**/*.ts",
"scripts/**/*.mts",
"scripts/**/*.cts",
"scripts/**/*.mjs",
"*.config.ts",
"packages/exojs-config/**/*.js",
"packages/exojs-bench/competitors/*.ts"
],
"exclude": ["scripts/exo-full.entry.ts"]
}