Handle imports used only in expressions properly
See original GitHub issueImport statement must not be marked as unused in following example
It happens because
ES6UnusedImportsHelper#isUnusedSpecifier
-> ES6UnusedImportsHelper#getLocalReferencesQuery
creates LocalSearchScope
containing only script tag, it should be containingFile
in case of Svelte.
My first dumb idea is to copy whole ES6UnusedImportsInspection
and change necessary lines, but this will be hard to maintain.
@anstarovoyt I’d appreciate your input here, thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Python import: Advanced Techniques and Tips
In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules ......
Read more >import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >Import Statements in TypeScript: Which Syntax to Use
TypeScript has multiple syntaxes for imports. When should you use which? It depends. In this blog, Jessica Kerr shares her thoughts, ...
Read more >5. The import system — Python 3.11.1 documentation
The import statement is the most common way of invoking the import machinery, but it is not the only way. Functions such as...
Read more >Understanding Modules and Import and Export Statements in ...
In this tutorial, you will learn what a JavaScript module is and how to use import and export to organize your code.
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 Free
Top 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
@unlocomqx this is related to directives support, they’re not references yet, so import mechanism can’t find them
@anstarovoyt Your suggestion with custom
SvelteJSReferenceExpression
works great, I just need to refine types evaluation. I’m gonna break my code into 2 PRs and redo #146 because as you’ve said weird reference search is no longer needed.Bonus points for fixed rename refactoring and ‘$’ not being treated as part of reference