Skip to content

Support ESLint flat config in dev-server lint plugin - #431

Closed
FSVetaz wants to merge 5 commits into
frontierMasterfrom
jordi/eslint-webpack-plugin-flat
Closed

Support ESLint flat config in dev-server lint plugin#431
FSVetaz wants to merge 5 commits into
frontierMasterfrom
jordi/eslint-webpack-plugin-flat

Conversation

@FSVetaz

@FSVetaz FSVetaz commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Bumps eslint-webpack-plugin from ^3.1.1 to ^5.0.3 and makes the dev-server lint plugin flat-config aware:

  • Apps with an eslint.config.{js,mjs,cjs} at their root are linted with that config directly. The plugin is given configType: 'flat' and eslintPath: 'eslint/use-at-your-own-risk', which exposes FlatESLint on ESLint 8.57 (on ESLint 9+ the plugin switches to loadESLint() and the same path keeps working). baseConfig/resolvePluginsRelativeTo are dropped in this branch — FlatESLint rejects both — and the react/react-in-jsx-scope fallback rule is passed as a flat-format baseConfig instead.
  • Apps without a flat config file keep the existing eslintrc behavior byte-for-byte (baseConfig extending @fs/eslint-config-frontier-react), with an explicit configType: 'eslintrc' since v5 of the plugin defaults to 'flat'.
  • ESLINT_USE_FLAT_CONFIG=false forces the legacy branch, mirroring the ESLint CLI escape hatch.
  • eslint dep bumped ^8.3.0^8.57.1 (8.57 is the first version whose use-at-your-own-risk entry exports FlatESLint/LegacyESLint, which the v5 plugin worker relies on).

Context

tree-person-r9 is migrating to flat config on ESLint 8 in fs-webdev/tree-person-r9#3799 (see it's why for why) and depends on this change for its dev-server lint overlay.That PR currently pins @fs/react-scripts@8.17.0-prerelease.9 (this branch's CI prerelease); once this PR is released, it switches to ^8.17.0, and any other flat-config adopter gets the same support.

Verification

The flat branch of this exact code is running in tree-person-r9 today via the 8.17.0-prerelease.9 build: npm start compiles and the overlay reports lint findings from the app's eslint.config.mjs (see fs-webdev/tree-person-r9#3799). The legacy branch is unchanged apart from the explicit configType.

🤖 Generated with Claude Code

Temporary CI workaround — remove before/after merge

webpack 5.110.2 currently breaks all Frontier builds (export 'css' was not found in '@linaria/core'Frontier Core announcement). To get a green build, publishPrReleaseAndCreateFreshCraTemplate.js temporarily pins webpack: 5.110.1 via overrides in the CI-scaffolded smoke-test app only (nothing shipped in the package). Remove that block once the fix ships in Zion packages.

Alternative considered

Consumer apps could adopt flat config without this PR by keeping a duplicate .eslintrc.json containing the same config in legacy format — the v3 plugin reads that file while the CLI/IDE read the flat one. Rejected: duplicated lint config is a ticking-time-bomb maintenance burden; once the copies drift, the dev-server overlay and the CLI/hooks/CI silently enforce different rules. Shipping flat support here fixes it once for every consumer.

FSVetaz and others added 4 commits September 2, 2026 10:17
Bump eslint-webpack-plugin to ^5 and instantiate it flat-aware: apps
with an eslint.config.{js,mjs,cjs} at their root get linted with that
config directly (via FlatESLint on ESLint 8.57), while apps without
one keep the legacy eslintrc baseConfig behavior unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
webpack 5.110.2 breaks builds with "export 'css' was not found in
'@linaria/core'". Pin via overrides in the scaffolded app only, per
Frontier Core's announced workaround; remove once the Zion fix ships.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It upgrades core lint tooling and changes webpack ESLint integration behavior across apps, so it warrants final human review despite only one concrete fix request.

Pull request overview

This PR updates @fs/react-scripts to support ESLint flat config (eslint.config.{js,mjs,cjs}) in the dev-server lint overlay by upgrading eslint-webpack-plugin and adjusting webpack’s ESLint plugin configuration to select flat vs legacy config behavior at runtime.

Changes:

  • Bump eslint-webpack-plugin to ^5.0.3 and eslint to ^8.57.1.
  • Update webpack.config.js to detect eslint.config.* and configure eslint-webpack-plugin with configType: 'flat' (or force legacy via ESLINT_USE_FLAT_CONFIG=false).
  • Add a temporary CI-only workaround in the prerelease scaffold script to pin webpack to 5.110.1 via overrides (per PR description).
File summaries
File Description
publishPrReleaseAndCreateFreshCraTemplate.js Temporarily pins webpack in the CI-scaffolded smoke-test app and reinstalls to apply overrides.
packages/react-scripts/package.json Bumps eslint and eslint-webpack-plugin versions and updates package version to 8.17.0.
packages/react-scripts/config/webpack.config.js Adds flat-config detection and configures ESLint plugin for flat vs eslintrc modes.
CHANGELOG-FRONTIER.md Documents the 8.17.0 release and the flat-config support behavior.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread publishPrReleaseAndCreateFreshCraTemplate.js Outdated
@FSVetaz
FSVetaz marked this pull request as ready for review September 2, 2026 17:37
@marybeshaw

Copy link
Copy Markdown

The Frontier Core team is going more heads-down on trying to prioritize SSR. We're going to be very careful with changes we make to the stack - especially to React-Scripts and Snow, but also our entire infrastructure.  This change falls in this range of changes we have decided to decline.

Please reach out to the Frontier Core team before starting stack & infrastructure improvements. We'd rather decline prospective changes before the PR is created. We will likely need to decline PRs that aren't specifically on our team's backlog.

Thanks for your understanding!

@FSVetaz FSVetaz closed this Sep 3, 2026
@FSVetaz
FSVetaz deleted the jordi/eslint-webpack-plugin-flat branch September 3, 2026 16:08
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.

3 participants