Skip to content

chore: [2329] Add TypeScript tooling - #2339

Merged
n-lark merged 4 commits into
mainfrom
2329-typescript-tooling
Oct 30, 2026
Merged

n-lark merged 4 commits into
mainfrom
2329-typescript-tooling

Conversation

@n-lark

@n-lark n-lark commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Sets up TypeScript so new files can be written in it. It's optional so existing JavaScript keeps working as-is and isn't type checked, so JS-only PRs aren't affected.

  • ui/tsconfig.json (replaces jsconfig.json) and nodes/tsconfig.json
  • npm run typecheck, which also runs as part of npm run lint
  • ESLint support for .ts files and <script lang="ts">
  • TypeScript pinned to ~6.0, since TS 7 doesn't work with vue-tsc yet
  • A short TypeScript section in the contributor docs

TypeScript under nodes/ needs a compile step, which comes with the first file that uses it (the data store, #2239).

Test plan

  • lint, typecheck, test and build pass
  • Type and lint errors are caught in .ts files and lang="ts" blocks
  • Dashboard and Node-RED editor load in a live Node-RED with no console errors

Related Issue(s)

Resolves #2329.

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@n-lark
n-lark requested a review from Steve-Mcl October 28, 2026 18:58
@n-lark n-lark self-assigned this Oct 28, 2026
@n-lark
n-lark marked this pull request as ready for review October 28, 2026 18:58
@n-lark
n-lark requested a review from cstns October 28, 2026 18:58
@andypalmi

Copy link
Copy Markdown

Pulled the branch and ran it locally.

Verified

  1. typecheck passes and lint:js has 0 errors.
  2. Deliberately bad .ts, lang="ts" and nodes/*.ts files are caught by vue-tsc, tsc and ESLint.
  3. typescript, tsc and vue-tsc all resolve to 6.0.3, so the ~6.0 pin holds.
  4. Removing ui/jsconfig.json loses nothing: its @/* alias is unused and not defined in vite.config.js.

Questions

  1. The description says docs "(en/de)" but the German translation was removed in dab994ef. Could it be updated?
  2. Could the docs say TypeScript isn't supported in /nodes yet, since there's no compile step?
  3. Is limiting the *.ts ESLint override to no-unused-vars intentional?
  4. @types/node is ^22 while CI runs Node 24. Is that deliberate?

@n-lark

n-lark commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Hey @andypalmi thanks for looking.

  1. Already updated, description no longer mentions de.
  2. Added a line to the contributor docs. It goes away when the data store PR adds the build step.
  3. Intentional, and .ts gets the same checks as JS. no-unused-vars is swapped for the TS version, and tsc covers no-undef and no-redeclare since typecheck runs in lint. All other rules still apply.
  4. Deliberate. ^22 is what Vite's peer range already had locked, so the lockfile doesn't change. Types should stay behind CI, since nodes/ still has to run on older Node.

@n-lark
n-lark requested a review from andypalmi October 30, 2026 13:23
@n-lark
n-lark merged commit 930b064 into main Oct 30, 2026
5 checks passed
@n-lark
n-lark deleted the 2329-typescript-tooling branch October 30, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TypeScript support

2 participants