-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support query parameters in import/no-unresolved
#2562
Comments
This plugin currently does not yet support native ESM, and node does not support query parameters in transpiled ESM. It's a good idea regardless to never use a query string in a specifier URL, but either way, this plugin will support it once |
Hi @ljharb, thanks for your answer. If you have time, could clarify two points?
Are you saying that
Could you explain why? |
I’m saying that eslint-plugin-import still expects a world where all ESM is transpiled into CJS. Sure - a query string suggests that you could get a different module from what conceptually would be expected to be the same specifier. Modules aren’t supposed to be dynamic, they’re supposed to be static. |
Oke, thanks for your time! |
Sorry to post in a closed issue, but I'm wondering if it would be possible to add some configuration options to ignore query strings until I am trying to import some SVGs with a query string e.g. |
- Not supported by eslint-plugin-import - import-js/eslint-plugin-import#2562 Signed-off-by: Grigorii K. Shartsev <[email protected]>
Passing parameters to a module can be done via the import url -- cf: https://flaming.codes/en/posts/es6-import-with-parameters. So
import "./lib.mjs?foo=bar
will cause node to load./lib.mjs
but it will be flagged by theimport/no-unresolved
rule because the file./lib.mjs?foo=bar
does not exist.The text was updated successfully, but these errors were encountered: