question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Definition for rule was not found

See original GitHub issue

Hello !

I’m trying to use eslint-config-airbnb-typescript in my project but WebStorm throw this errors:

ESLint: Definition for rule '@typescript-eslint/comma-dangle' was not found.(@typescript-eslint/comma-dangle)
ESLint: Definition for rule '@typescript-eslint/no-loop-func' was not found.(@typescript-eslint/no-loop-func)
ESLint: Definition for rule '@typescript-eslint/no-redeclare' was not found.(@typescript-eslint/no-redeclare)
ESLint: Definition for rule '@typescript-eslint/no-shadow' was not found.(@typescript-eslint/no-shadow)

.eslintrc.js:

module.exports = {
  parser: '@typescript-eslint/parser',
  plugins: [
    '@typescript-eslint',
  ],
  extends: [
    'airbnb-typescript/base',
  ],
  parserOptions: {
    project: './tsconfig.eslint.json',
  },
};

tsconfig.eslint.json:

{
  "extends": "./tsconfig.json",
  "include": ["./src", ".eslintrc.js"]
}

Dev dependencies from package.json:

{
    "@types/node": "^14.0.13",
    "@typescript-eslint/eslint-plugin": "^2.29.0",
    "@typescript-eslint/eslint-plugin-tslint": "^4.9.0",
    "@typescript-eslint/parser": "^2.34.0",
    "concurrently": "^5.3.0",
    "eslint": "^7.15.0",
    "eslint-config-airbnb-typescript": "^12.0.0",
    "eslint-plugin-import": "^2.22.1",
    "nodemon": "^2.0.6",
    "typescript": "^4.1.2"
  }

All this rules seems to be present from the lib/shared.js file.

Did I missed something ?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
TimothyJonescommented, Dec 8, 2020

"@typescript-eslint/eslint-plugin": "^2.29.0", <-- this is too old for those rules. For example, @typescript-eslint/comma-dangle was added in 4.2.0.

I would use the same version for both @typescript-eslint dependencies:

"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/eslint-plugin-tslint": "^4.9.0",
3reactions
paulrbergcommented, Nov 16, 2021

@pellelauritsen I am on node v16.6.1 and just like @stefanpl I am getting hundreds of errors when running ESLint via the terminal. By that, I mean when I’m running yarn start in a CRA-enabled app:

Capture d’écran 2021-11-16 à 23 18 09

Running ESLint in standalone fashion works fine. Did anyone find a solution to this issue?

Update: downgrading to v18 the eslint-config-airbnb package made the error go away. There must a breaking change that causes this error.

2nd Update: it looks like this is a known issue, though no solution proposed in that thread worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint why does my plugin show Definition for rule was not ...
It means eslint cannot find rules in your index.js . Try having a look at your index ...
Read more >
Definition for rule typescript-eslint no-shadow was not found
I am working on migrating from tslint to eslint. The basic migration seems ... Definition for rule typescript-eslint no-shadow was not found.
Read more >
How To Write a Custom ESLint Rule | by Carrie Reid-Knox
If it identifies that a node is in violation of a defined rule, ... see that the linter rule did not fire, and...
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
"suggestion" means the rule is identifying something that could be done in a better way but no errors will occur if the code...
Read more >
Code Quality eslint jest plugin reports rule definitions not found
Summary When specifying eslint-plugin-jest rules in .eslintrc.json, code_quality job reports definition not found for most rules, e.g..
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found