We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should support import assertions. This may require the acorn-import-assertions plugin.
Static imports with assertions look like this:
import data from "./data.json" assert {type: "json"};
Dynamic imports with assertions look like this:
const data = await import("./data.json", {assert: {type: "json"}});
Both of these currently generate syntax errors with Acorn, but are supported by most browsers.
The text was updated successfully, but these errors were encountered:
Maybe worth mentioning that ESLint won't add support for import attributes until they become Stage 4 and fails to parse a file that contains them.
Sorry, something went wrong.
These are now called “import attributes” and use with instead of assert. Still not widely supported though.
with
assert
Successfully merging a pull request may close this issue.
We should support import assertions. This may require the acorn-import-assertions plugin.
Static imports with assertions look like this:
Dynamic imports with assertions look like this:
Both of these currently generate syntax errors with Acorn, but are supported by most browsers.
The text was updated successfully, but these errors were encountered: