You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There doesn’t seem to be a way to import a JSON module purely as type.
Minimum reproduction:
// error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import assertion with the type of "json".importtype*astfrom"./a.json";
Linter will also report a no-assert-type error. However, if you add the assertion as suggested by the linter, you get:
// error: TS2822 [ERROR]: Import assertions cannot be used with type-only imports or exports.importtype*astfrom"./a.json" assert {type: "json"};
The text was updated successfully, but these errors were encountered:
I guess it makes sense that TS doesn't like import assertions on type-only imports, they don't serve their purpose in that context. Accordingly deno_graph shouldn't enforce assertions (or lack thereof) on type-only imports.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Bug report
There doesn’t seem to be a way to import a JSON module purely as type.
Minimum reproduction:
Linter will also report a
no-assert-type
error. However, if you add the assertion as suggested by the linter, you get:The text was updated successfully, but these errors were encountered: