Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove any querystring from imports #67

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

joakimbeng
Copy link
Contributor

Vite supports querystrings in imports like for instance: import svg from "./image.svg?raw" (imports the file contents as a string).

Such an import gets wrongly marked as unresolved by the rule import/no-unresolve when using this resolver.

The webpack resolver strips querystrings so that import/no-unresolve correctly can resolve those imports.

This PR adds the same feature to eslint-import-resolver-typescript.

@JounQin
Copy link
Collaborator

JounQin commented Feb 3, 2021

Thanks. Just wondering why lastIndexOf is used instead of indexOf.

@joakimbeng
Copy link
Contributor Author

I didn't think that much about it, I just did what the webpack resolver do 😁
I guess lastIndexOf will be slightly faster for imports with query strings and be as fast as indexOf for imports without.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants