Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new workspaces with ESLint v9 and typescript-eslint v8 #27451

Closed
3 of 4 tasks
JamesHenry opened this issue Aug 15, 2024 · 11 comments · Fixed by #27404
Closed
3 of 4 tasks

Create new workspaces with ESLint v9 and typescript-eslint v8 #27451

JamesHenry opened this issue Aug 15, 2024 · 11 comments · Fixed by #27404
Assignees
Labels
PR status: in-progress scope: linter Issues related to Eslint support in Nx type: feature

Comments

@JamesHenry
Copy link
Collaborator

Current Behavior

New workspaces are created with ESLint v8 (and its eslintrc config format), and typescript-eslint v7, which is now the previous major version.

Expected Behavior

New workspaces are created with ESLint v9 (and its default flat config format) and typescript-eslint v8.

Existing workspaces should not be forcibly migrated, but they have access to the conversion generator if they choose to use it.

GitHub Repo

No response

Steps to Reproduce

npx create-nx-workspace with any stack.

Nx Report

All

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This issue was created to be able to close duplicates and focus attention and discussion in one place.

@AlexanderShabalinMaersk

is there any news about this?

jaysoo added a commit that referenced this issue Sep 12, 2024
…int v8 (#27404)

Closes #27451

---------

Co-authored-by: Leosvel Pérez Espinosa <[email protected]>
Co-authored-by: Jack Hsu <[email protected]>
@cmcnicholas
Copy link

Hi guys, what's the situation with this? I can't find any external documentation but this looks to be merged, how would one go about migrating v8 to v9 in an existing nx repo?

@robertIsaac
Copy link
Contributor

Hi guys, what's the situation with this? I can't find any external documentation but this looks to be merged, how would one go about migrating v8 to v9 in an existing nx repo?

it's part of nx 19.8, which in beta now

@kbrilla
Copy link

kbrilla commented Sep 23, 2024

Hi, @JamesHenry , thx for this PR, I have but one problem after migrating to new configuration.
This PR silently added plugin:@angular-eslint/template/accessibility which is not mentioned anywhere and makes Christmas Tree out of old projects when switched to flat config manually. New way of configuring eslint should not add/remove any rules compared to existing config.

@robertIsaac
Copy link
Contributor

Hi, @JamesHenry , thx for this PR, I have but one problem after migrating to new configuration. This PR silently added plugin:@angular-eslint/template/accessibility which is not mentioned anywhere and makes Christmas Tree out of old projects when switched to flat config manually. New way of configuring eslint should not add/remove any rules compared to existing config.

I like your expression of "makes Christmas Tree"

as a workaround you can turn off the rules
here is the full list
https://github.com/angular-eslint/angular-eslint/blob/159658fcd5174728533877ff36dc091644a44944/packages/angular-eslint/src/configs/template-accessibility.ts#L4
so to turn them off you do

      '@angular-eslint/template/alt-text': 'off',
      '@angular-eslint/template/click-events-have-key-events': 'off',
      '@angular-eslint/template/elements-content': 'off',
      '@angular-eslint/template/interactive-supports-focus': 'off',
      '@angular-eslint/template/label-has-associated-control': 'off',
      '@angular-eslint/template/mouse-events-have-key-events': 'off',
      '@angular-eslint/template/no-autofocus': 'off',
      '@angular-eslint/template/no-distracting-elements': 'off',
      '@angular-eslint/template/role-has-required-aria': 'off',
      '@angular-eslint/template/table-scope': 'off',
      '@angular-eslint/template/valid-aria': 'off',

or even better turn off the ones doing the noise in the project

me personally I'm not strongly with or against adding it, but I think there should be an option to optout for example to have flat-configs/angular-template-no-accessibility but the default to be flat-configs/angular-template

@kbrilla
Copy link

kbrilla commented Sep 23, 2024

I also found out that new

Hi, @JamesHenry , thx for this PR, I have but one problem after migrating to new configuration. This PR silently added plugin:@angular-eslint/template/accessibility which is not mentioned anywhere and makes Christmas Tree out of old projects when switched to flat config manually. New way of configuring eslint should not add/remove any rules compared to existing config.

I like your expression of "makes Christmas Tree"

as a workaround you can turn off the rules here is the full list https://github.com/angular-eslint/angular-eslint/blob/159658fcd5174728533877ff36dc091644a44944/packages/angular-eslint/src/configs/template-accessibility.ts#L4 so to turn them off you do

      '@angular-eslint/template/alt-text': 'off',
      '@angular-eslint/template/click-events-have-key-events': 'off',
      '@angular-eslint/template/elements-content': 'off',
      '@angular-eslint/template/interactive-supports-focus': 'off',
      '@angular-eslint/template/label-has-associated-control': 'off',
      '@angular-eslint/template/mouse-events-have-key-events': 'off',
      '@angular-eslint/template/no-autofocus': 'off',
      '@angular-eslint/template/no-distracting-elements': 'off',
      '@angular-eslint/template/role-has-required-aria': 'off',
      '@angular-eslint/template/table-scope': 'off',
      '@angular-eslint/template/valid-aria': 'off',

or even better turn off the ones doing the noise in the project

me personally I'm not strongly with or against adding it, but I think there should be an option to optout for example to have flat-configs/angular-template-no-accessibility but the default to be flat-configs/angular-template

"makes Christmas Tree" means that it start to light up just like Christmas lights on Christmas tree, never though that it might be just a local saying.

On subject though: yeah, I have nothing against adding accessibility rules to config - I was just confused and tries to figure out where those rules comes from. Maybe adding that to description of changes, would save me from some digging. As for workaround, I already fixed most issues, but thanks anyway :)

@CyanoFresh
Copy link

CyanoFresh commented Sep 25, 2024

why don't anyone say about missing support by eslint-plugin-import for eslint@9? Workspace is created, react app generated, but I can't run npm i anymore

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^9.8.0" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.4.0" from @typescript-eslint/[email protected]
npm ERR!     node_modules/@typescript-eslint/utils
npm ERR!       @typescript-eslint/utils@"^8.0.0" from @nx/[email protected]
npm ERR!       node_modules/@nx/eslint-plugin
npm ERR!         dev @nx/eslint-plugin@"19.8.0" from the root project
npm ERR!         1 more (@nrwl/eslint-plugin-nx)
npm ERR!       3 more (@typescript-eslint/eslint-plugin, ...)
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from [email protected]
npm ERR!   6 more (@nx/eslint, @typescript-eslint/eslint-plugin, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from [email protected]
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"2.30.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from [email protected]
npm ERR!   node_modules/eslint-plugin-import
npm ERR!     dev eslint-plugin-import@"2.30.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 

@pumano
Copy link
Contributor

pumano commented Oct 4, 2024

@CyanoFresh today they (eslint-plugin-import) released support version 2.31

@pumano
Copy link
Contributor

pumano commented Oct 4, 2024

@JamesHenry eslint 9 has --quiet param, that not run warn rules. When I pass that param via:

nx run-many --exclude=lib1,lib2 --target=lint --quiet

that param not passed to eslint, just filter warnings instead for eslint 9 should not run rules with warnings totally.

I created separated issue #28291

@CyanoFresh
Copy link

@pumano thanks, now it's working fine

@JamesHenry
Copy link
Collaborator Author

Hi Folks, please open fresh issues with full context and steps to reproduce. The work represented by this issue has been completed and so the issue has been closed. Whilst we always try our best on every effort we ship, it doesn't mean that the work is guaranteed to be perfect, and any remaining imperfections are what we will work on addressing as soon as possible and as soon as we have clear steps on how to reproduce them. It is not possible to keep track of comments on closed issues, and they are overwhelming likely to not provide steps to reproduce, unlike a fresh issue.

Many thanks!

@nrwl nrwl locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR status: in-progress scope: linter Issues related to Eslint support in Nx type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants