Definition for rule 'import/no-extraneous-dependencies' was not found
See original GitHub issueHello.
I have this rule in my .eslintrc.json
:
"import/no-extraneous-dependencies": [
"warn",
{
"devDependencies": false,
"optionalDependencies": false,
"peerDependencies": false,
"bundleDependencies": false,
"packageDir": "./"
}
]
But for a few files I have an error:
C:\Users\vlad\source\repos\project_name\src\environments\environment.ts
1:1 error Definition for rule 'import/no-extraneous-dependencies' was not found import/no-extraneous-dependencies
Here’s file:
export const environment = {
production: false,
hmr: true,
var1: "val1",
var2: "val2",
varn: "varn"
};
It’s not only for the env.file, but also for the files with just functions and even for some Angular components where I have a lot of import {} from ''
. Everytime it fails on the first line, first symbol. Looks like this rule is just not working.
"@angular-eslint/builder": "^2.0.2",
"@angular-eslint/eslint-plugin": "2.0.2",
"@angular-eslint/eslint-plugin-template": "^2.0.2",
"@angular-eslint/schematics": "2.0.2",
"@angular-eslint/template-parser": "2.0.2",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/parser": "4.16.1",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^32.3.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-sonarjs": "^0.6.0",
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
eslint-plugin-import/no-extraneous-dependencies.md at main
Forbid the import of external modules that are not declared in the package.json 's dependencies , devDependencies , optionalDependencies , peerDependencies , or ......
Read more >Why (and How Can I FIx) ESLint import/no-extraneous ...
If you arrived here while searching for 'Definition for rule 'import/no-extraneous-dependencies' was not found'.
Read more >A Guide to ESLint | Laurie on Tech
While this is helpful, some rules need to get more specific. For example, ESLint has a rule called import/no-extraneous-dependencies . The goal ...
Read more >node_modules/eslint-plugin-import/docs/rules/no-extraneous ...
Forbid the import of external modules that are not declared in the package.json 's dependencies , devDependencies , optionalDependencies , ...
Read more >Why am I getting "Definition for rule 'import/no-extraneous ...
[Solved]-Why am I getting "Definition for rule 'import/no-extraneous-dependencies' was not found" when running ESLint?-babel.js · Related Query · More Query from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same issue, but in my case I forgot to extend the plugin in my
eslintrc
file, hope it helps.Ran into this too ^ upgrading eslint from v7.32.0 -> v8.9.0
Both extends and manual config
Failed to load plugin 'import' declared in '.eslintrc.js'
, which fixed/resolved by upgrading eslint-plugin-import from v2.24.2 -> v2.25.4