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-duplicates] False positive on multiple imports from submodules

See original GitHub issue

I am seeing the following warning twice for .../node_modules/firebase/empty-import.d.ts' imported multiple times import/no-duplicates for the following code:

import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';

Interesting I am no seeing this warning if its simply

import firebase from 'firebase/app';
import 'firebase/database';

Additionally I saw this PR https://github.com/benmosher/eslint-plugin-import/pull/1612 where a comment is made about circling back on the second case. The fact that the second case isn’t triggering a warning makes me think that maybe this is just a bug handling 3 and not 2 🤷‍♂️ .

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Jan 14, 2022

@the-ult here, which is why there’s a help wanted label.

1reaction
ljharbcommented, Aug 18, 2021

@murilocp you’re correct, those are two different specifiers/modules and should not be warned on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

feature request: add ignore options for `import/no-duplicates`
This seems like an inherent flaw in resolving a module to a d.ts file that might represent multiple files. I don't think forcing...
Read more >
Avoiding pylint complaints when importing Python packages ...
The false-positive imports can be nested in an enable-disable block without losing any coverage elsewhere: import sys sys.path.insert(0, '.
Read more >
"Unused import" warning for module ... - YouTrack - JetBrains
PY-23573 False positive: unused import warning for multiple imports from one ... When importing multiple submodules and referencing the full namespace, ...
Read more >
5. The import system — Python 3.11.1 documentation
The import statement combines two operations; it searches for the named module, then it binds the results of that search to a name...
Read more >
no-duplicate-imports | typescript-eslint
no-duplicate-imports. Disallow duplicate imports. Deprecated. This rule has been deprecated in favour of the import/no-duplicates rule.
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