Skip to content

Roll out v3 (modern flat config) across consumer repos #48

Description

@kpal81xd

Roll out v3 (modern flat config) across consumer repos

Now that @playcanvas/eslint-config@3.0.0-beta.x is installable and published on the beta dist-tag, this tracks migrating every active public PlayCanvas repo that consumes the config onto v3 — plus bringing a couple of active repos that don't yet use it (create-playcanvas, react) onto the shared config. vscode-extension is the proof of concept (CommonJS + /typescript).

All open consumer PRs below pin 3.0.0-beta.6. Status legend: 🟢 ready (open · CI green) · 🟡 draft (open · held on strict-error triage) · 🟣 merged · 🔴 not started (no PR yet).

Tracking

Wave Repo Tier PR Status
PoC vscode-extension /typescript playcanvas/vscode-extension#312 🟢 ready · 🟣 adoption playcanvas/vscode-extension#311 merged
1 observer /typescript playcanvas/observer#64 🟡 draft
1 canvas-mock /javascript playcanvas/canvas-mock#7 🟢 ready
1 pcui-graph /legacy playcanvas/pcui-graph#146 🟢 ready
2 supersplat-viewer /typescript playcanvas/supersplat-viewer#259 🟡 draft
2 playcanvas-sync /legacy playcanvas/playcanvas-sync#113 🟢 ready
2 attribute-parser /javascript playcanvas/attribute-parser#66 🟢 ready
2 editor-mcp-server /typescript playcanvas/editor-mcp-server#82 🟡 draft
2 texture-tool /typescript playcanvas/texture-tool#38 🟡 draft
2 model-viewer /typescript + /react playcanvas/model-viewer#381 🟡 draft
3 web-components /typescript playcanvas/web-components#245 🟡 draft
3 splat-transform /typescript playcanvas/splat-transform#255 🟡 draft
3 pcui /typescript + /react playcanvas/pcui#541 🟡 draft
4 supersplat /typescript playcanvas/supersplat#918 🟡 draft
4 editor /typescript playcanvas/editor#2076 🟡 draft
5 engine /javascript 1 playcanvas/engine#8843 🟡 draft
new 2 create-playcanvas /typescript playcanvas/create-playcanvas#43 🟡 draft
new 2 react /typescript + /react playcanvas/react#322 🟡 draft

The breaking change every consumer must make

In v3 the default export is an object { legacy, typescript, react }, not a spreadable array. So the v2 pattern breaks and must switch to a subpath import:

- import playcanvasConfig from '@playcanvas/eslint-config';
- export default [...playcanvasConfig, /* overrides */];
+ import typescript from '@playcanvas/eslint-config/typescript'; // or /javascript, /legacy
+ export default [...typescript, /* overrides */];

Notes:

  • Tiers: /typescript (modern strict), /javascript = /legacy (the v2 ruleset — ~drop-in, no new errors), /react.
  • /react is additive-only (JSX / a11y / hooks, no base rules) — React repos must compose /typescript + /react (in that order) or they end up silently under-linted.
  • Prettier now runs as its own step via the shared /prettier config + eslint-config-prettier (drop eslint-plugin-prettier).
  • esmScriptTags is re-exported from the package root so the engine can extend JSDoc definedTags without reaching into config internals.
  • /typescript bundles neither jsdoc nor regexp (they live in /legacy). Migrating a TS repo that had jsdoc/* or regexp/* rules or inline eslint-disable directives will surface "Definition for rule … was not found" — remove the stale references/directives as part of triage.
  • Triage policy for the /typescript drafts: keep the shared config strict and adapt the repos to pass (no rule weakening); no-explicit-any stays an error. Only planned config touches are eslint-plugin-chai-friendly (chai-assertion false-positives) and scoped inline-disables where TypeScript requires interface (declaration merging).
  • Known config gap: subpath exports ship no type declarations (only /prettier does), so eslint.config.mjs imports show as implicit any in TS-aware editors. Cosmetic; doesn't affect linting.

Skipped (intentionally out of scope)

  • playcanvas-spine — still on v1 (^1.7.1); needs an ESLint-9 flat-config migration before it can take v3 at all. Revisit when it modernizes.
  • playcanvas-inspector — on v1 (^1.0.16) and dormant (last commit 2022).
  • playcanvas-tween — dormant (last commit Jan 2025).
  • markdown-translator — dormant (last commit Jul 2025).

Promote 3.0.0latest

Target the end of Wave 2. Promotion is low-risk on its own — every consumer pins 2.1.0/^2.x, so flipping latest force-upgrades no one; it only changes what a bare install and the repo template resolve to. Before promoting:

  • ≥5–6 consumers across all three tiers running v3 green on their default branch for ~2 weeks
  • new-strict-error rate measured on a small repo and shown to be auto-fixable / triable
  • engine has at least a green proof-of-concept branch
  • README warning that the TS/React tiers are "still being developed" softened/removed
  • cut a non-prerelease 3.0.0 and move the latest dist-tag
  • update the repo template to the v3 subpath import so new repos inherit v3
  • documented rollback: npm dist-tag add @playcanvas/eslint-config@2.1.0 latest

Footnotes

  1. engine also rewrites the v2 playcanvasConfig.find(...) JSDoc definedTags hack to the direct import { esmScriptTags }, and migrates the examples/ secondary config to /javascript + /react. Highest blast radius — done last. The examples/ /react ruleset still needs config-level tuning (react-in-jsx-scope under the React 19 JSX transform, prop-types, import/extensions) — tracked in the PR.

  2. New adoptions, not v2→v3 migrations — these two don't currently consume @playcanvas/eslint-config. create-playcanvas has no shared-config dependency today; react runs its own flat config (eslint 9 + typescript-eslint + eslint-plugin-react + eslint-plugin-react-compiler, a packages/* monorepo). Adopting v3 here replaces their existing setup, so expect more than a drop-in. 2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions