Possible FAQ needed, correct combination of importOrderParserPlugins for Angular parameter decorators #122
Replies: 3 comments 2 replies
-
actually, it looks like this isn't covered in https://github.com/trivago/prettier-plugin-sort-imports/blob/master/tests/Angular/imports-with-decorators.js so it might be worth being an actual issue to capture that. |
Beta Was this translation helpful? Give feedback.
-
I've had better results in angular using the decorators-legacy plugin instead. Maybe I'm missing something but I think this config should work
Please tell me if that solves your issue. Regardless, this is not the first time people report issues with angular projects. So the doc might need some update 😅 |
Beta Was this translation helpful? Give feedback.
-
+1, I'm having the exact same issue as @Sebastian-G and @adam-marshall, which effectively renders this plugin unusable to me. I'm on a NestJS project, though, so using Angular doesn't seem to be the issue. |
Beta Was this translation helpful? Give feedback.
-
If I use parameter decorators e.g. https://angular.io/api/core/Self#usage-notes
I receive the following error
SyntaxError: Decorators cannot be used to decorate parameters.
I saw similar closed issues but it is still not clear to me today what the correct configuration would be to allow this, I currently use:
"importOrderParserPlugins" : [ "typescript", "classProperties", "[\"decorators\", { \"decoratorsBeforeExport\": true }]"]
I tried a few things but no joy yet.
Beta Was this translation helpful? Give feedback.
All reactions