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

@nx/eslint: eslintConfig config option not working #20777

Closed
1 of 4 tasks
knoefel opened this issue Dec 14, 2023 · 2 comments · Fixed by #20863
Closed
1 of 4 tasks

@nx/eslint: eslintConfig config option not working #20777

knoefel opened this issue Dec 14, 2023 · 2 comments · Fixed by #20863
Assignees
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug

Comments

@knoefel
Copy link

knoefel commented Dec 14, 2023

Current Behavior

After initialising a new nx nextjs workspace and migrating to eslint flat config i get the following error after setting the eslintConfig prop in the lint section of project.json.

TypeError: Key "rules": Key "@typescript-eslint/no-array-constructor": Could not find plugin "@typescript-eslint".

This only happens when i explicitly link a eslint.config.js file via eslintConfig and don't use the root eslint configuration.

Expected Behavior

Its possible to run the lint task after upgrading to flat config

GitHub Repo

https://github.com/knoefel/nx-eslint-flat-config

Steps to Reproduce

  1. create new nx workspace
  2. run nx generate @nx/eslint:convert-to-flat-config
  3. update the app config for the lint target by setting a esLintConfig property:
    "lint": {
      "executor": "@nx/eslint:lint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "eslintConfig": "apps/lint/eslint.config.js"
      }
    }
  1. run nx lint lint

Nx Report

Node   : 20.10.0
   OS     : darwin-arm64
   npm    : 10.2.4
   
   nx (global)        : 17.1.1
   nx                 : 17.2.4
   @nx/js             : 17.2.4
   @nx/jest           : 17.2.4
   @nx/linter         : 17.2.4
   @nx/eslint         : 17.2.4
   @nx/workspace      : 17.2.4
   @nx/devkit         : 17.2.4
   @nx/eslint-plugin  : 17.2.4
   @nx/next           : 17.2.4
   @nx/playwright     : 17.2.4
   @nx/react          : 17.2.4
   @nrwl/tao          : 17.2.4
   @nx/web            : 17.2.4
   typescript         : 5.2.2

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@mandarini mandarini added the scope: linter Issues related to Eslint support in Nx label Dec 15, 2023
@meeroslav meeroslav self-assigned this Dec 20, 2023
@meeroslav
Copy link
Contributor

Thank you @knoefel for reporting this.

The fix is on the way.

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants