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-unresolved raises false positives in many projects

See original GitHub issue

I think import/no-unresolved isn’t the kind of rule that belongs in a linting config, because it makes a lot of assumptions about how modules are resolved, leading to false positives in many common cases. For example in Webpack, the use of aliases or non-traditional but registered extensions such as .vue will raise a linting error when Webpack actually has no problems resolving these files.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

7reactions
jimbollacommented, Jun 6, 2016

There’s a webpack resolver for eslint-plugin-import that handles things like extensions and aliases.

3reactions
chrisvfritzcommented, Jun 5, 2016

Hmm… this plugin is definitely the only other tool that I’ve had to configure - even on large projects with very demanding build processes. So it does seem strange to have to duplicate that config, especially because it comes with no advantages I can see. Webpack and other build tools already provide very helpful module resolution errors (on save with a dev server) and never trigger false positives. 😕

As someone who maintains a project generator for thousands of other developers, this is the only Airbnb rule I’ve had to disable completely - and it was in direct response to people opening issues about the confusing errors they get from ESLint when using Webpack aliases.

It seems clear this is a wontfix though, so I’ll drop it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pylint false positive E0401 import errors in vscode while using ...
vscode was trying to use the globally installed pylint which simply was not aware of dependencies I installed in my Python venv. This...
Read more >
rollup.js
If false is returned for moduleSideEffects and no other module imports anything from this module, then this module will not be included in...
Read more >
found several packages and main redeclared as the imported ...
False -positives: found several packages and main redeclared as the imported package name ... GO-12784 Upgrade to v1.18 raises errors in "net/http" import....
Read more >
Using kapt | Kotlin Documentation
If your project contains Java classes, kapt will also take care of them. ... in order to avoid false-positive cache hits for the...
Read more >
Statistical significance for genomewide studies - PNAS
The false positive rate and FDR are often mistakenly equated, ... to identify many truly alternative features without including too many false positives....
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