Skip to content

Migrate to @playcanvas/eslint-config v3 (/typescript + /react)#381

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

Migrate to @playcanvas/eslint-config v3 (/typescript + /react)#381
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 rollout in playcanvas/eslint-config#48.

What changed

Subpath migration (typescript + react). v3 ships tiered subpath exports instead of a single default config. This is a React app, so it now composes both tiers — /react is additive (JSX / a11y / hooks rules only) and is spread on top of /typescript:

import typescriptConfig from '@playcanvas/eslint-config/typescript';
import reactConfig from '@playcanvas/eslint-config/react';
export default [...typescriptConfig, ...reactConfig, ...overrides];
  • Dropped the redundant manual @typescript-eslint plugin/parser wiring and tsPlugin.configs.recommended.rules spread — /typescript provides typescript-eslint recommended + strict + stylistic.
  • Dropped the manual import/resolver settings block — /typescript wires the resolver internally via import-x/resolver-next.
  • Removed now-defunct jsdoc/* overrides (jsdoc is no longer part of the /typescript tier).
  • import → import-x namespace: renamed import/no-unresolvedimport-x/no-unresolved (v3's /typescript uses eslint-plugin-import-x). No eslint-disable import/* comments existed in source.
  • Kept genuine repo overrides: @typescript-eslint/{ban-ts-comment,no-explicit-any,no-unused-vars}: 'off', browser globals for .ts/.tsx, node globals + import-x/no-unresolved: 'off' for .js/.mjs.
  • Added a small but necessary override: /typescript only wires the TS parser for **/*.{js,mjs,ts}, so .tsx files get parser: tseslint.parser explicitly (this app has many .tsx files).

Version bump. @playcanvas/eslint-config 2.1.03.0.0-beta.5 (carries the import-x resolver fix; verified no import-x/no-unresolved false positives).

devDep cleanup (now bundled transitively by the config, unused elsewhere):

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

Kept eslint, typescript, react/react-dom (runtime), and all build/test deps.

Lint result

lint:fix auto-fixed formatting/order issues across 19 source files. 28 residual errors remain (all genuine findings from v3's stricter ruleset — not config-load errors). Left unfixed per the rollout process:

Count Rule Sample
13 @typescript-eslint/prefer-for-of src/debug-lines.ts:402
3 no-prototype-builtins src/helpers.ts:32
3 @typescript-eslint/consistent-type-definitions src/index.tsx:24
3 jsx-a11y/alt-text src/ui/index.tsx:51
2 import-x/order src/index.tsx:18
1 @typescript-eslint/no-extraneous-class src/dummy-webgpu.ts:3
1 no-empty src/index.tsx:210
1 jsx-a11y/click-events-have-key-events src/ui/load-controls.tsx:69
1 jsx-a11y/no-static-element-interactions src/ui/load-controls.tsx:69

Draft until the residual is triaged/fixed in a follow-up.

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