Support ESLint flat config in dev-server lint plugin - #431
Conversation
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>
There was a problem hiding this comment.
🔵 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-pluginto^5.0.3andeslintto^8.57.1. - Update
webpack.config.jsto detecteslint.config.*and configureeslint-webpack-pluginwithconfigType: 'flat'(or force legacy viaESLINT_USE_FLAT_CONFIG=false). - Add a temporary CI-only workaround in the prerelease scaffold script to pin webpack to
5.110.1viaoverrides(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.
|
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! |
Summary
Bumps
eslint-webpack-pluginfrom^3.1.1to^5.0.3and makes the dev-server lint plugin flat-config aware:eslint.config.{js,mjs,cjs}at their root are linted with that config directly. The plugin is givenconfigType: 'flat'andeslintPath: 'eslint/use-at-your-own-risk', which exposesFlatESLinton ESLint 8.57 (on ESLint 9+ the plugin switches toloadESLint()and the same path keeps working).baseConfig/resolvePluginsRelativeToare dropped in this branch — FlatESLint rejects both — and thereact/react-in-jsx-scopefallback rule is passed as a flat-formatbaseConfiginstead.@fs/eslint-config-frontier-react), with an explicitconfigType: 'eslintrc'since v5 of the plugin defaults to'flat'.ESLINT_USE_FLAT_CONFIG=falseforces the legacy branch, mirroring the ESLint CLI escape hatch.eslintdep bumped^8.3.0→^8.57.1(8.57 is the first version whoseuse-at-your-own-riskentry exportsFlatESLint/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.9build:npm startcompiles and the overlay reports lint findings from the app'seslint.config.mjs(see fs-webdev/tree-person-r9#3799). The legacy branch is unchanged apart from the explicitconfigType.🤖 Generated with Claude Code
Temporary CI workaround — remove before/after merge
webpack
5.110.2currently breaks all Frontier builds (export 'css' was not found in '@linaria/core'— Frontier Core announcement). To get a green build,publishPrReleaseAndCreateFreshCraTemplate.jstemporarily pinswebpack: 5.110.1viaoverridesin 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.jsoncontaining 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.