Closed wmertens closed 2 years ago
to import json in an ESM project under Node 18, you can use import assertions, and Espree doesn't seem to parse this syntax (I couldn't find a fixture and eslint doesn't parse either of these syntaxes).
https://v8.dev/features/import-assertions
import json from './foo.json' assert { type: 'json' }; await import('./foo.json', { assert: { type: 'json' } });
Import assertions are stage 3 at the moment, and we don't implement new syntax until they reach stage 4.
You can still open an issue on ESLint for this to prepare for the stage change.
to import json in an ESM project under Node 18, you can use import assertions, and Espree doesn't seem to parse this syntax (I couldn't find a fixture and eslint doesn't parse either of these syntaxes).
https://v8.dev/features/import-assertions