Skip to content

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

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

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

Conversation

@kpal81xd

@kpal81xd kpal81xd commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Migrates this repo to @playcanvas/eslint-config v3, adopting the /typescript subpath tier. Part of the rollout in playcanvas/eslint-config#48.

Changes

  • Subpath migration: import playcanvasConfig from '@playcanvas/eslint-config'import typescriptConfig from '@playcanvas/eslint-config/typescript'. The /typescript tier provides the typescript-eslint parser + plugin (for **/*.{js,mjs,ts}, globals.node) and the import-x resolver out of the box.
  • Removed redundant wiring: dropped the manual @typescript-eslint/parser + @typescript-eslint/eslint-plugin imports and their parser/plugin config blocks, the manual import/resolver node-settings block (now supplied by the tier), and the now-defunct jsdoc/* rule overrides (the /typescript tier has no jsdoc plugin).
  • Namespace: renamed import/no-unresolvedimport-x/no-unresolved (v3 registers eslint-plugin-import-x natively).
  • Kept the repo-specific **/*.ts extra globals (browser + mocha + node), no-use-before-define: off, and the test-file no-unused-expressions: off block.
  • Dependency bump: pinned @playcanvas/eslint-config to 3.0.0-beta.5 (carries the import-x resolver fix) and removed @typescript-eslint/eslint-plugin + @typescript-eslint/parser from devDependencies (only referenced by the old config; the tier now provides them). Regenerated package-lock.json.

Auto-fixed (lint:fix)

3 source files auto-fixed (src/history.ts, src/observer-history.ts, src/observer.ts): import-x/consistent-type-specifier-style (value→type imports), redundant default-value type annotations, and stale eslint-disable directives.

Residual errors — EXPECTED, needs a separate typing pass

This is a TS lib that leans heavily on any. 154 residual errors remain after auto-fix (no config-load errors). These are intentionally NOT hand-fixed here:

rule count sample
@typescript-eslint/no-explicit-any 93 src/event-handle.ts:51
no-prototype-builtins 19 src/observer.ts:370
@typescript-eslint/no-this-alias 14 src/observer.ts:301
@typescript-eslint/no-unused-expressions 14 test/observer.test.mjs:35
prefer-rest-params 8 src/event-handle.ts:56
@typescript-eslint/prefer-for-of 3 src/events.ts:167
@typescript-eslint/no-unsafe-function-type 3 src/observer.ts:57
total 154

Note: the 14 @typescript-eslint/no-unused-expressions hits are chai assertions in test/observer.test.mjs. The existing test override disables the base no-unused-expressions, but the /typescript tier reports the TS-namespaced variant, which the override doesn't cover. Folded into the separate triage along with the no-explicit-any typing work.

Opened as draft because residual errors are expected and require a follow-up typing pass.

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