ES6 'no-unused-vars' ignore unused import declarations
See original GitHub issueWould like to add an option to the ‘no-unused-vars’ rule to ignore unused imports.
For instance:
import plugin from 'plugin'; // defined as a UMD object with a jquery dependency and exports jQuery.fn.plugin
import $ from 'jquery';
$(ele).plugin();
I see this as useful as there are many libraries that add to global objects that are required before the original global object is imported.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How can I remove unused imports/declarations from the entire ...
If rules contains no-unused-vars , eslint will "fix" the unused import by removing them (along with other auto fixes).
Read more >no-unused-vars - ESLint - Pluggable JavaScript Linter
Rule Details This rule is aimed at eliminating unused variables, functions, and function parameters. A variable foo is considered to be used if...
Read more >eslint-plugin-unused-imports - npm
Find and remove unused es6 module imports. It works by splitting up the no-unused-vars rule depending on it being an import statement in...
Read more >Automatically Remove Unused Imports From Your JS Projects
For this reason, I prefer to set ignoreDeclarationSort to true . It is for the best anyway because this rule provides minimal customization...
Read more >eslint-plugin-unused-imports - npm package - Snyk
Find and remove unused es6 module imports. It works by splitting up the no-unused-vars rule depending on it being an import statement in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👎. Use
import 'plugin'
.ah, good to know. Thanks