Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definition for rule '@nrwl/nx/nx-plugin-checks' was not found

Using NX v14.1.4, I'm trying to run linting on a lib that contains a custom executor and I get this error.

My config is:

{
  "extends": ["../../.eslintrc.json"],
  "ignorePatterns": ["!**/*"],
  "overrides": [
    {
      "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
      "rules": {}
    },
    {
      "files": ["*.ts", "*.tsx"],
      "rules": {}
    },
    {
      "files": ["*.js", "*.jsx"],
      "rules": {}
    },
    {
      "files": ["./package.json", "./generators.json", "./executors.json"],
      "parser": "jsonc-eslint-parser",
      "rules": {
        "@nrwl/nx/nx-plugin-checks": "error"
      }
    }
  ]
}

The parent config is

{
  "root": true,
  "ignorePatterns": ["**/*"],
  "plugins": ["@nrwl/nx"],
  "overrides": [
    {
      "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
      "rules": {
        "@nrwl/nx/enforce-module-boundaries": [
          "error",
          {
            "enforceBuildableLibDependency": true,
            "allow": [],
            "depConstraints": [
              {
                "sourceTag": "*",
                "onlyDependOnLibsWithTags": ["*"]
              }
            ]
          }
        ]
      }
    },
    {
      "files": ["*.ts", "*.tsx"],
      "extends": ["plugin:@nrwl/nx/typescript"],
      "rules": {}
    },
    {
      "files": ["*.js", "*.jsx"],
      "extends": ["plugin:@nrwl/nx/javascript"],
      "rules": {}
    },
    {
      "files": "*.json",
      "parser": "jsonc-eslint-parser",
      "rules": {}
    }
  ]
}
like image 879
caisah Avatar asked Sep 03 '25 06:09

caisah


1 Answers

I fixed it by adding "@nx", short for "@nx/eslint-plugin", in my plugins field in the root eslint config. Also, remember to install @nx/eslint-plugin

{
  ...
  "plugins": [..., "@nx"],
  ...
}
like image 108
tscpp Avatar answered Sep 05 '25 00:09

tscpp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!