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-plugin should ignore .nx folder globally #29767

Open
4 tasks
ardokirsipuu opened this issue Jan 27, 2025 · 0 comments
Open
4 tasks

@nx/eslint-plugin should ignore .nx folder globally #29767

ardokirsipuu opened this issue Jan 27, 2025 · 0 comments
Assignees
Labels
scope: linter Issues related to Eslint support in Nx type: bug

Comments

@ardokirsipuu
Copy link

ardokirsipuu commented Jan 27, 2025

Current Behavior

Currently the @nx/eslint-plugin has the .nx folder ignored non-globally.

Read here what I mean with global vs non-global ignores: https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores

https://github.com/nrwl/nx/blob/master/packages/eslint-plugin/src/flat-configs/base.ts:

export default [
  {
    plugins: {
      get ['@nx']() {
        return require('../index');
      },
    },
    ignores: ['.nx'],
  },
];

Expected Behavior

Expecting the .nx folder to be ignored globally, for example:

export default [
  {
    plugins: {
      get ['@nx']() {
        return require('../index');
      },
    },
  },
  {
    ignores: ['.nx'], // <-- in its own config object with only the `ignores` key specified
  },
];

GitHub Repo

No response

Steps to Reproduce

  1. Create some sorts of monorepo workspace which has eslint set up, e.g. npx create-nx-workspace@latest with these answers:
    Image
  2. Run npx nx run org:build to generate some content to the .nx folder
  3. Run npx eslint and see all the linting errors for .nx folder's contents

Nx Report

Node           : 22.13.1
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.9.2

nx                     : 20.3.3
@nx/js                 : 20.3.3
@nx/jest               : 20.3.2
@nx/eslint             : 20.3.3
@nx/workspace          : 20.3.3
@nx/devkit             : 20.3.3
@nx/eslint-plugin      : 20.3.3
@nx/module-federation  : 20.3.3
@nx/next               : 20.3.3
@nx/react              : 20.3.3
@nx/web                : 20.3.3
@nx/webpack            : 20.3.3
typescript             : 5.6.3
---------------------------------------
Registered Plugins:
@nx/next/plugin
@nx/jest/plugin
@nx/eslint/plugin
---------------------------------------

Failure Logs

✖ 18100 problems (17528 errors, 572 warnings)
  6734 errors and 1 warning potentially fixable with the `--fix` option.

Package Manager Version

No response

Operating System

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

Additional Information

I hope Nx does not prohibit the usage of eslint outside of packages/libs/apps 👀

@FrozenPandaz FrozenPandaz added the scope: linter Issues related to Eslint support in Nx label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants