Open jasus opened 2 years ago
I've solved this problem by adding a more value typescript
on importOrderParserPlugins
.
@samchon And what exactly values did you add there that everything worked?
@ducker-dev "importOrderParserPlugins": ["typescript", "classProperties", "decorators-legacy"]
I have this config
importOrderParserPlugins: [
'typescript',
'classProperties',
"[\"decorators\", { \"decoratorsBeforeExport\": true }]"
],
but now I'm getting this SyntaxError: Decorators cannot be used to decorate parameters.
I'm using NestJS
Your Environment
Describe the bug
First error
When I add this prettier-plugin-sort-import with no configuration I have an error like this:
SyntaxError: This experimental syntax requires enabling one of the following parser plugin(s): "decorators-legacy", "decorators"
Second error
When I add decorators configuration:
have this error on each ts file:
SyntaxError: Missing semicolon.
SyntaxError: Unexpected reserved word 'private'
SyntaxError: Unexpected token, expected "{"
To Reproduce
Running prettier command to fix issues:
prettier --write **/*.{ts,js,json,md,html}
Expected behavior
No Syntax error using
prettier-plugin-sort-imports
Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
First error
.prettierrc
Second error:
.prettierrc