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 Unknown options: reportUnusedDisableDirectives after upgrading to eslint 8.56.0 #20943

Closed
1 of 4 tasks
broksonic21 opened this issue Dec 28, 2023 · 6 comments · Fixed by #21405
Closed
1 of 4 tasks
Assignees
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug

Comments

@broksonic21
Copy link

Current Behavior

 >  NX   Invalid Options:

   - Unknown options: reportUnusedDisableDirectives
   - 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.

Error: Invalid Options:
- Unknown options: reportUnusedDisableDirectives
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
    at processOptions (/Users/REDACTED/REDACTED/node_modules/eslint/lib/eslint/eslint-helpers.js:783:15)
    at new FlatESLint (/Users/REDACTED/REDACTED/node_modules/eslint/lib/eslint/flat-eslint.js:556:34)
    at resolveAndInstantiateESLint (/Users/REDACTED/REDACTED/node_modules/@nx/eslint/src/executors/lint/utility/eslint-utils.js:65:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (/Users/REDACTED/REDACTED/node_modules/@nx/eslint/src/executors/lint/lint.impl.js:47:32)

Expected Behavior

@nx/eslint 17.2.8 and eslint 8.56.0 work same after upgrading.

GitHub Repo

No response

Steps to Reproduce

have on a private repo right now, will look into a public one

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 20.10.0
   OS     : darwin-arm64
   npm    : 10.2.5

   nx             : 17.2.8
   @nx/js         : 17.2.8
   @nx/jest       : 17.2.8
   @nx/linter     : 17.2.8
   @nx/eslint     : 17.2.8
   @nx/workspace  : 17.2.8
   @nx/devkit     : 17.2.8
   @nrwl/tao      : 17.2.8
   typescript     : 5.3.3
   ---------------------------------------
   Community plugins:
   nx-stylelint : 17.1.0

Failure Logs

>  NX   Invalid Options:

   - Unknown options: reportUnusedDisableDirectives
   - 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.

Error: Invalid Options:
- Unknown options: reportUnusedDisableDirectives
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
    at processOptions (/Users/REDACTED/REDACTED/node_modules/eslint/lib/eslint/eslint-helpers.js:783:15)
    at new FlatESLint (/Users/REDACTED/REDACTED/node_modules/eslint/lib/eslint/flat-eslint.js:556:34)
    at resolveAndInstantiateESLint (/Users/REDACTED/REDACTED/node_modules/@nx/eslint/src/executors/lint/utility/eslint-utils.js:65:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (/Users/REDACTED/REDACTED/node_modules/@nx/eslint/src/executors/lint/lint.impl.js:47:32)

Package Manager Version

No response

Operating System

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

Additional Information

only happens after upgrading to eslint 8.56.0 using flag config

@AdarshKonchady
Copy link

Seeing this issue as well. Seems to be happening due to the option here - https://github.com/nrwl/nx/blob/master/packages/eslint/src/executors/lint/utility/eslint-utils.ts#L52-L53

@AgentEnder AgentEnder added the scope: linter Issues related to Eslint support in Nx label Jan 9, 2024
@meeroslav meeroslav self-assigned this Jan 18, 2024
@ShaneYu
Copy link

ShaneYu commented Jan 25, 2024

Until this issue has been resolved, does anyone know of a workaround? Is there a way to remove this option in our ESLint configuration files or something?

@arklanq
Copy link

arklanq commented Jan 25, 2024

Until this issue has been resolved, does anyone know of a workaround? Is there a way to remove this option in our ESLint configuration files or something?

Downgrade ESLint to 8.55.X.

@AdarshKonchady
Copy link

If you want to be on the latest eslint 8.56.0 version till there's a Nx fix for this, I was able to get it to work by using eslint directly in Nx project.json "lint" instead of using @nx/linter:

"lint": {
      "executor": "nx:run-commands",
      "options": {
        "commands": ["pnpm eslint packages/PACKAGE_NAME"],
        "parallel": false
      }
    },

@meeroslav
Copy link
Contributor

meeroslav commented Jan 30, 2024

If you want to be on the latest eslint 8.56.0 version till there's a Nx fix for this, I was able to get it to work by using eslint directly in Nx project.json "lint" instead of using @nx/linter:

This would be the proper workaround to do it outside of @nx/eslint plugin:

"lint": {
  "command": "eslint .", // lint everything at the current working directory
  "options": {
    "cwd": "{projectRoot}", // this tells the above command to run in your project's folder
  }
}

Copy link

github-actions bot commented Mar 4, 2024

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 Mar 4, 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
6 participants