-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decorators problem for Angular project. #12
Comments
@temofey1989 What is your prettier config in Just a guess would be that you are not defining the |
@byara, you are right.
Nevertheless, now I have another problem...
This looks not really prettiery... 😄 |
I have the same problem, now all the files look minimized. {
parser: 'angular',
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
jsxBracketSameLine: false,
arrowParens: 'avoid',
rangeStart: 0,
rangeEnd: Infinity,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
importOrder: ['^rxjs/(.*)$', '^@angular/(.*)$', '^[./]'],
importOrderSeparation: true,
} |
@temofey1989 @szaboge could you also please provide your babel config? |
@byara I don't have custom babel config, I use default Angular CLI for the build.
|
The angular formatter is only used for angular HTML, as suggested by the prettier docs:
You instead should be using typescript as the typescript language hasn't been extended by Angular. However, doing that returns you to the original error about experimental features. We discovered that changing this line
to
and with the following babel config (in
seemed to solve the issues with the unsupported syntax, but then ran into issues with the comments being stripped from files as #13 hasn't made it into a release yet. |
* [#12] handle babel config better * [#12] simplify parsers * abstract getBabelConf out * Pass plugins through rc file * implement getParserPlugins * add parser names as constants * one function def per file, separate constants and types, clean up * clean yp flow types, constants and getParserPlugins return type * pass util functions directly * add test for new API * add LiteralUnion for parser types * Clean up types * update depencencies except babel * update babel * change getBabelConf name, add comment to tsPlugin as to why we are adding them by default * remove unused babel config * update types for experimentalBabelParserPluginsList as ParserPlugin * update readme Co-authored-by: Behrang Yarahmadi <behrang.yarahmdi@trivago.com>
With the release of v2.0.1, this should be fixed. If there was still problems, you can of course re-open this issue. |
Update: I posted this reply in a new issue: #86 Hi @byara (or whoever is working on this now), Thanks for making and maintaining this plugin!
For example, @ShigotoMitame was using the
It seems like the
When adding these options directly in
As a work around I was wondering if you would consider supporting taking the plugins directly from a babelrc file, or at least allowing JSON in the experimentalBabelParserPluginsList array to support plugins with options. |
As of now, with prettier-plugin-sort-imports v3.2.0, I was able to solve it with the following config:
Escaped double quotes inside |
I've got this error with prettier formatting when using sequelize typescript syntax
and adding this to .prettierrc solved my problem
|
Hello,
I tried to use the plugin in the Angular project and got this error:
I use:
What am I doing wrong?
Is there any workaround?
Thanks a lot.
NOTE: No problem with React.
The text was updated successfully, but these errors were encountered: