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.

import/no-extraneous-dependencies not working on windows

See original GitHub issue

What I am doing: Lint file with import/no-extraneous-dependencies enabled and which importing debug module, that is not presented in package.json dependencies

Expected behavior: The error should be displayed

Actual behavior: Linting finish successfully

OS: Windows 10 x64 1809

Investigation Find problem in function importTypes -> isSubpath. It not treating module as external because of working only with forward slashes as path separators. Looks like normalization for paths is needed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SkReDcommented, Mar 25, 2020

This is fixed here https://github.com/benmosher/eslint-plugin-import/commit/47f912e74eccbb6009ea5778a7cdb33e918dd495. Tests for no-extraneous-dependencies are passing on windows now.

0reactions
ljharbcommented, Mar 25, 2020

A PR with a failing test case on windows would be great; then i can validate when it’s fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why (and How Can I FIx) ESLint import/no-extraneous ...
I solved it simply by setting devDependencies to true. ... Then to fix this issue you should add "plugins": ["import"] in your .eslintrc ......
Read more >
[import/no-extraneous-dependencies] Problems when only ...
We've started to see failures when moving from 2.18.2 to 2.20.0 regarding importing only types from devDependencies in TypeScript source ...
Read more >
eslint/eslint - Gitter
If you work on a team, see if anyone else is having the same problem. Kamran Tahir ... Run 'npm i -S assert'...
Read more >
eslint-plugin-import - npm
Start using eslint-plugin-import in your project by running `npm i ... Forbid the use of extraneous packages ( no-extraneous-dependencies ) ...
Read more >
[note] ESLint | PJCHENder 未整理筆記
npx eslint --init # To check syntax, find problems, and enforce ... 這個錯誤,可以在 rules 的地方針對 'import/no-extraneous-dependencies' 的 ...
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