fix(linter): handle variable references in replaceOverride#34026
fix(linter): handle variable references in replaceOverride#34026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 08dcdc1
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
We classified these failures as environment_state because none of them relate to the PR's changes to ESLint flat config parsing. The failures involve unrelated areas: plugin linting validation logic, React module federation runtime timeouts, and JSON parsing errors during project generation. The e2e-eslint test also shows a 0.44% flakiness rate, indicating intermittent environmental issues rather than problems introduced by the AST-based variable reference handling added in this PR.
No code changes were suggested for this issue.
If the issue was transient, you can trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
The migration generator (@nx/plugin:migration) fails when the project's
ESLint flat config contains variable references in property values, such as:
`plugins: { 'package-json': pluginPackageJson }`
This happens because `replaceOverride` uses `parseTextToJson` to parse
the config, which fails for non-JSON-serializable JavaScript expressions.
The migration generator should work correctly even when the ESLint config
contains variable references. The fix applies the same approach used in
PR #33548 for `hasOverride`: using AST-based property extraction instead
of JSON parsing.
Fixes #34010
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The migration generator (`@nx/plugin:migration`) fails when due to ESLint flat config not being parsed correctly, leading to an error. This happens because `replaceOverride` uses `parseTextToJson` to parse the config, which fails for non-JSON-serializable JavaScript expressions. This PR fixes the issue by using AST parsing, like we did for `hasOverrides` here #33548. Fixes #34010 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |

The migration generator (
@nx/plugin:migration) fails when due to ESLint flat config not being parsed correctly, leading to an error.This happens because
replaceOverrideusesparseTextToJsonto parse the config, which fails for non-JSON-serializable JavaScript expressions.This PR fixes the issue by using AST parsing, like we did for
hasOverrideshere #33548.Fixes #34010