Skip to content

fix(lint): make Flat Config work with ESLint 8; remove legacy config; scope to assets/js/src#911

Merged
robruiz merged 1 commit intowprig:developfrom
erdmann040:fix/restore-lint
Sep 13, 2025
Merged

fix(lint): make Flat Config work with ESLint 8; remove legacy config; scope to assets/js/src#911
robruiz merged 1 commit intowprig:developfrom
erdmann040:fix/restore-lint

Conversation

@erdmann040
Copy link
Contributor

Closes: #910

Description

Bug: A recent script change ran ESLint without loading eslint.config.js. With ESLint 8, Flat Config is not auto-loaded, so linting appeared inactive/inconsistent.

Fix:

  • Enable Flat Config explicitly for ESLint 8 using ESLINT_USE_FLAT_CONFIG=true (cross-platform via cross-env).
  • Remove the legacy eslintConfig block from package.json to avoid accidental fallback to eslintrc.
  • Keep the lint scope to assets/js/src/**/*.{js,jsx,ts,tsx} (as intended).

Changes

  • package.json:
    • lint:jscross-env ESLINT_USE_FLAT_CONFIG=true eslint "assets/js/src/**/*.{js,jsx,ts,tsx}"
    • remove eslintConfig block
    • (optional, unused) remove old "babel" config

No runtime code paths changed; tooling only.

How to test

  1. rm -rf node_modules && npm ci
  2. npm run lint:js
  3. Expect ESLint to apply rules from eslint.config.js
  4. If VS Code squiggles don’t appear immediately: Reload Window*.

Checklist

  • Bug fix verified locally (npm run lint:js works again)
  • Linked to ticket (add number above)
  • [] CHANGELOG updated under Fixes / Tooling
  • I want my code added to WP Rig

@erdmann040 erdmann040 requested a review from robruiz as a code owner September 6, 2025 14:59
@robruiz robruiz merged commit 70f9748 into wprig:develop Sep 13, 2025
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.

2 participants