You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[patch] make no-extraneous-dependencies include only paths that can be resolved,
as only resolved paths can be reliably tested if they live in a `node_modules` folder.
Up until now, this rule assumed, that every package that lives in a `node_modules` folder
or *cannot be resolved* is an external package.
This happens because of [that line](https://github.com/benmosher/eslint-plugin-import/blob/master/src/core/importType.js#L32).
If project uses aliasing, or transforms imports, this assumption is wrong,
as they may not be resolvable by import plugin, but also, they should not be defined in package.json.
Changing `isExternalPath` will make any ordering lints unstable
(order may change depending if you ran `npm install` or not).
Using `import/ignore` setting does not make sense too, as it's used to ignore imports unknown to the plugin,
like .css files. But still, you may import a css file from a dependency, and this rule should check that.
Copy file name to clipboardExpand all lines: docs/rules/no-extraneous-dependencies.md
+2
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
Forbid the import of external modules that are not declared in the `package.json`'s `dependencies`, `devDependencies`, `optionalDependencies` or `peerDependencies`.
4
4
The closest parent `package.json` will be used. If no `package.json` is found, the rule will not lint anything. This behaviour can be changed with the rule option `packageDir`.
5
5
6
+
Modules have to be installed for this rule to work.
0 commit comments