Skip to content

Migrate to @playcanvas/eslint-config v3 (/typescript)#245

Draft
kpal81xd wants to merge 2 commits into
mainfrom
eslint-config-v3
Draft

Migrate to @playcanvas/eslint-config v3 (/typescript)#245
kpal81xd wants to merge 2 commits into
mainfrom
eslint-config-v3

Conversation

@kpal81xd

@kpal81xd kpal81xd commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Part of the v3 rollout — playcanvas/eslint-config#48.

Changes

  • Subpath migration: replaced the v2 default-import spread with the dedicated subpath
    config: import typescriptConfig from '@playcanvas/eslint-config/typescript' and
    export default [...typescriptConfig, ...overrides].
  • Removed redundant manual wiring: the old config hand-wired the TS parser/plugin and
    spread tsPlugin.configs.recommended.rules, plus an import/resolver settings block.
    The /typescript config now provides the @typescript-eslint parser+plugin
    (recommended/strict/stylistic), the import-x resolver, jsdoc, and package-json rules,
    so all of that was dropped.
  • import/*import-x/* namespace: renamed the eslint-disable import/order directive
    in src/index.ts to import-x/order. Dropped the manual import/resolver settings block.
  • Dropped now-defunct jsdoc/* overrides (require-param-type, require-returns-type).
  • Kept genuine overrides: browser globals for examples/**/*.mjs and the **/*.ts
    block's browser + custom globals (AddEventListenerOptions, EventListener,
    EventListenerOptions), and the project's @typescript-eslint/* off suppressions
    (ban-ts-comment, no-explicit-any, no-unused-vars).

Version bump

  • Pinned @playcanvas/eslint-config to exactly 3.0.0-beta.5 (carries the import-x
    resolver fix). Regenerated package-lock.json.

devDep cleanup

Removed direct devDeps now bundled transitively by /typescript:

  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint-import-resolver-typescript

(globals kept — still referenced directly in eslint.config.mjs overrides.)

Lint result

Ran an auto-fix pass (eslint ... --fix): 102 errors + 5 warnings auto-fixed
(113/5 → 11/0). Auto-fixes were consistent-type-imports (import type), array-type
(Array<T>T[]), redundant type-annotation removal, and import-x/order reordering.
tsc --noEmit and rollup -c both pass after the fixes.

11 residual errors remain (not hand-fixed — pre-existing genuine findings):

Rule Count Sample
@typescript-eslint/no-unused-vars 8 examples/assets/scripts/camera-feed.mjs:84
@typescript-eslint/no-empty-function 1 src/components/component.ts:44
no-prototype-builtins 1 src/components/particlesystem-component.ts:55
@typescript-eslint/consistent-type-definitions 1 src/components/script-component.ts:21

Note: in examples/js/example.mjs the auto-fixer removed a now-unused
eslint-disable-next-line no-unused-vars directive (the active rule is now the
@typescript-eslint/* variant), leaving a stray-whitespace line. Harmless; left as-is
to keep the auto-fix pass unmodified.

Opened as a draft pending decisions on the residual findings above.

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.

1 participant