Skip to content

fix(linter): support eslint v9#24632

Merged
JamesHenry merged 3 commits intomasterfrom
support-eslint-v9
May 22, 2024
Merged

fix(linter): support eslint v9#24632
JamesHenry merged 3 commits intomasterfrom
support-eslint-v9

Conversation

@JamesHenry
Copy link
Copy Markdown
Collaborator

@JamesHenry JamesHenry commented May 22, 2024

Current Behavior

  • Nx's built in ESLint rules use deprecated APIs which have been removed in v9
  • The Nx crystal plugin for ESLint doesn't work with eslintrc config by default (the user would need to set an env var manually)

Expected Behavior

The built in Nx rules work with ESLint v8 and v9, the crystal plugin works with eslintrc and flat config on both ESLint v8 and v9.

Related Issue(s)

Fixes #22769

@vercel
Copy link
Copy Markdown

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview May 22, 2024 2:30pm

create(context) {
// jsonc-eslint-parser adds this property to parserServices where appropriate
if (!(context.parserServices as any).isJSON) {
if (!(context.sourceCode.parserServices as any).isJSON) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't need to wrap this here, it is not a shared rule, so we just migrate the usage

@JamesHenry JamesHenry marked this pull request as ready for review May 22, 2024 15:06
@JamesHenry JamesHenry merged commit 8cfc0a0 into master May 22, 2024
@JamesHenry JamesHenry deleted the support-eslint-v9 branch May 22, 2024 15:27
FrozenPandaz pushed a commit that referenced this pull request May 22, 2024
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@nx/eslint-plugin throws an error in Eslint 9

2 participants