Skip to content
New issue

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

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

Already on GitHub? # to your account

Use "import attributes" instead of "import assertions" #74

Open
andrewbrey opened this issue Aug 23, 2024 · 2 comments
Open

Use "import attributes" instead of "import assertions" #74

andrewbrey opened this issue Aug 23, 2024 · 2 comments

Comments

@andrewbrey
Copy link

Per the history of the TC39 spec for this feature (https://github.com/tc39/proposal-import-attributes?tab=readme-ov-file#history) the most current syntax for "import attributes" uses the with keyword instead of the assert keyword.

Usage of this module with Deno (as of Deno 1.46, ref) now causes a deprecation warning due to usage of the deprecated "import assertions" syntax in user-agent.ts:

import untypedUserAgents from './user-agents.json' assert { type: 'json' };

Since this is deprecated syntax (and also because using assert instead of with causes a warning in Deno and eventually, likely, in other runtimes) it would be great to update the one "import assertion" that uses assert { type: 'json' } to instead be an "import attribute" that uses the with keyword, e.g. with { type: 'json' }

@EHadoux
Copy link

EHadoux commented Oct 4, 2024

It's not just a warning, it's a SyntaxError on node 22.

@EHadoux
Copy link

EHadoux commented Dec 3, 2024

Any update on this?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants