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.

no-unused-vars should have an importIgnorePattern

See original GitHub issue

The version of ESLint you are using. 6.8.0

The problem you want to solve.

I have a custom stringify helper that I may add in any file for debugging purpose, and I’m tired of adding/removing the import constantly. I cannot leave the import in the file, as eslint would nag me constantly about the unused import. I do not wish either to have // eslint-disable-next-line no-unused-vars in all my files.

Solution: Be able to disable no-unused-vars for some unused imports.

Currently a similar feature exists for function arguments argsIgnorePattern. But it does not seem to apply for unused imports.

Your take on the correct solution to problem.

{ 
  no-unused-vars': ['warn', { 'importIgnorePattern': '^stringify$' }] 
}

Are you willing to submit a pull request to implement this change? It depends on the complexity.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
anikethsahacommented, May 24, 2020

It looks like it can be good for a custom plugin / rule.

0reactions
mdjermanoviccommented, Jul 28, 2020

@francisminu

For typescript code you should use @typescript-eslint/no-unused-vars or @typescript-eslint/no-unused-vars-experimental instead of the core no-unused-vars rule.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignoring the Spelling of Proper Nouns - Word Ribbon Tips
David wants Word to ignore the spelling of proper nouns when doing a spell check. It seems that his documents contain many, many...
Read more >
5. Categorizing and Tagging Words - NLTK
Lexical categories like "noun" and part-of-speech tags like NN seem to have their uses, but the details will be obscure to many readers....
Read more >
Linguistic Features · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >
Dealer's Guide to the Used Car Rule
Most car dealers who sell used vehicles must comply with the Federal Trade Commission's (FTC's) Used Car Rule. In fact, car dealers who...
Read more >
Importing a Motor Vehicle | U.S. Customs and Border Protection
U.S. residents importing a new or used car should consult the Department of Motor Vehicles (DMV) in their state of residence about temporary ......
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