Closed jase88 closed 6 months ago
Your Environment
Describe the bug
Error if using import attribute with:
SyntaxError: Unexpected token, expected "{"
To Reproduce
import something from './something.json' with { type: 'json' };
https://v8.dev/features/import-attributes#deprecation-and-eventual-removal-of-assert
Expected behavior
Formatting works as for assert with importAssertions
importAssertions
import something from './something.json' assert { type: 'json' };
Screenshots, code sample, etc
see above
Configuration File (.prettierrc)
{ "plugins": ["@trivago/prettier-plugin-sort-imports"], "singleQuote": true, "trailingComma": "es5", "importOrder": ["<THIRD_PARTY_MODULES>", "^@company/(.*)$", "^[./]"], "importOrderParserPlugins": ["typescript", "decorators-legacy", "importAttributes"], "importOrderSeparation": true, "importOrderSortSpecifiers": true }
Error log
✖ prettier --write: [error] script.mjs: SyntaxError: Unexpected token, expected "{" (2:58) [error] 1 | import something from './something.json' assert { type: 'json' };
Contribute to @trivago/prettier-plugin-sort-imports
Probably duplicate of https://github.com/trivago/prettier-plugin-sort-imports/issues/270
Your Environment
Describe the bug
Error if using import attribute with:
To Reproduce
https://v8.dev/features/import-attributes#deprecation-and-eventual-removal-of-assert
Expected behavior
Formatting works as for assert with
importAssertions
Screenshots, code sample, etc
see above
Configuration File (.prettierrc)
Error log
✖ prettier --write: [error] script.mjs: SyntaxError: Unexpected token, expected "{" (2:58) [error] 1 | import something from './something.json' assert { type: 'json' };
Contribute to @trivago/prettier-plugin-sort-imports