Skip to content

Commit 013f145

Browse files
authored
Upgrade to TS7 for local type-checking (Stirling-Tools#6815)
# Description of Changes We can't convert to TS7 completely yet because it lacks the TS API, so ESLint and some of our scripts don't work, but we can do [what the TS team suggest and run TS6 and TS7 side-by-side](https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#compiler). When we do that, we take the `task frontend:typecheck:all` job from ~76s to ~13s, and everything else continues to work as it did before. I've set it so that CI will still use TS6 for the time being and locally we use TS7 out of an abundance of caution because CI time doesn't really matter but local time does. I do think it was a bit pointless doing that since the TS team claim the type checking performs identically, but we might as well have it like that for now. If it happens to go badly locally for any devs, they can use `CI=true task frontend:typecheck` to revert to use TS6 trivially.
1 parent eea9696 commit 013f145

3 files changed

Lines changed: 227 additions & 67 deletions

File tree

.taskfiles/frontend.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,64 +295,81 @@ tasks:
295295
cmds:
296296
- task: typecheck:proprietary
297297

298+
typecheck:_run:
299+
internal: true
300+
env:
301+
CI: '{{ .CI | default "false" }}'
302+
cmds:
303+
- '{{ if eq .CI "true" }}npx tsc{{ else }}npx tsgo{{ end }} --noEmit --project {{.PROJECT}}'
304+
298305
typecheck:core:
299306
desc: "Typecheck core build variant"
300307
deps: [prepare]
301308
cmds:
302-
- npx tsc --noEmit --project editor/src/core/tsconfig.json
309+
- task: typecheck:_run
310+
vars: { PROJECT: editor/src/core/tsconfig.json }
303311

304312
typecheck:proprietary:
305313
desc: "Typecheck proprietary build variant"
306314
deps: [prepare]
307315
cmds:
308-
- npx tsc --noEmit --project editor/src/proprietary/tsconfig.json
316+
- task: typecheck:_run
317+
vars: { PROJECT: editor/src/proprietary/tsconfig.json }
309318

310319
typecheck:saas:
311320
desc: "Typecheck SaaS build variant"
312321
deps:
313322
- task: prepare
314323
vars: { MODE: saas }
315324
cmds:
316-
- npx tsc --noEmit --project editor/src/saas/tsconfig.json
325+
- task: typecheck:_run
326+
vars: { PROJECT: editor/src/saas/tsconfig.json }
317327

318328
typecheck:desktop:
319329
desc: "Typecheck desktop build variant"
320330
deps:
321331
- task: prepare
322332
vars: { MODE: desktop }
323333
cmds:
324-
- npx tsc --noEmit --project editor/src/desktop/tsconfig.json
334+
- task: typecheck:_run
335+
vars: { PROJECT: editor/src/desktop/tsconfig.json }
325336

326337
typecheck:cloud:
327338
desc: "Typecheck cloud shared layer (standalone)"
328339
deps: [prepare]
329340
cmds:
330-
- npx tsc --noEmit --project editor/src/cloud/tsconfig.json
341+
- task: typecheck:_run
342+
vars: { PROJECT: editor/src/cloud/tsconfig.json }
331343

332344
typecheck:scripts:
333345
desc: "Typecheck scripts"
334346
deps: [prepare]
335347
cmds:
336-
- npx tsc --noEmit --project scripts/tsconfig.json
337-
- npx tsc --noEmit --project editor/scripts/tsconfig.json
348+
- task: typecheck:_run
349+
vars: { PROJECT: scripts/tsconfig.json }
350+
- task: typecheck:_run
351+
vars: { PROJECT: editor/scripts/tsconfig.json }
338352

339353
typecheck:prototypes:
340354
desc: "Typecheck prototypes build variant"
341355
deps: [prepare]
342356
cmds:
343-
- npx tsc --noEmit --project editor/src/prototypes/tsconfig.json
357+
- task: typecheck:_run
358+
vars: { PROJECT: editor/src/prototypes/tsconfig.json }
344359

345360
typecheck:portal:
346361
desc: "Typecheck developer portal build variant"
347362
deps: [install]
348363
cmds:
349-
- npx tsc --noEmit --project portal/tsconfig.json
364+
- task: typecheck:_run
365+
vars: { PROJECT: portal/tsconfig.json }
350366

351367
typecheck:shared:
352368
desc: "Typecheck the shared design system"
353369
deps: [install]
354370
cmds:
355-
- npx tsc --noEmit --project shared/tsconfig.json
371+
- task: typecheck:_run
372+
vars: { PROJECT: shared/tsconfig.json }
356373

357374
typecheck:all:
358375
desc: "Typecheck all build variants"

0 commit comments

Comments
 (0)