Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

📎 Formatter should be able to handle Angular @Component decorators #4049

Closed
jpike88 opened this issue Dec 12, 2022 · 2 comments
Closed

📎 Formatter should be able to handle Angular @Component decorators #4049

jpike88 opened this issue Dec 12, 2022 · 2 comments
Labels
A-Formatter Area: formatter enhancement New feature request or improvement to existing functionality S-Planned Status: planned by the team, but not in the short term

Comments

@jpike88
Copy link

jpike88 commented Dec 12, 2022

Description

See some example code from one of my Angular components.

Screenshot 2022-12-13 at 12 40 36 am

Screenshot 2022-12-13 at 12 45 55 am

Specifically, the template and styles properties in the @component decorator use HTML and CSS respectively. Rome Formatter should be aware of these specific properties (which are really the only two I know in common usage) and auto-format them accordingly.

Also, I noticed that selector and template properties don't get auto-indented. It's like Rome ignores everything in the decorator.

Prettier does this, by the way. So using Rome as a formatter will be a major problem for any Angular dev until the above case is handled

@jpike88 jpike88 added the task A task, an action that needs to be performed label Dec 12, 2022
@xunilrj
Copy link
Contributor

xunilrj commented Dec 13, 2022

Thanks for the suggestion. We are starting to focus on specific demands of frameworks. We will definitely pay attention more to React, Vue, Svelte and Agular.

Although we don't have a hard deadline to give you about Angular.

It's like Rome ignores everything in the decorator.

Yes. That is what is happening. Unfortunately see #3197

So using Rome as a formatter will be a major problem for any Angular dev until the above case is handled

This is something that we definitely want to address.

@xunilrj xunilrj added enhancement New feature request or improvement to existing functionality A-Formatter Area: formatter and removed task A task, an action that needs to be performed labels Dec 13, 2022
@ematipico ematipico added the S-Planned Status: planned by the team, but not in the short term label Dec 13, 2022
@jpike88
Copy link
Author

jpike88 commented Jan 23, 2023

I am desperately struggling to use Rome instead of eslint, it's at a point where enabling eslint is vscode is causing crashes to occur:

microsoft/vscode#171691

The only real obstacle right now is that Rome doesn't recognised import statements as used when they're a decorator. As a stop gap, I would highly recommend doing the minimum as a priority, which is to parse decorator names so the import statements are considered 'used' in that file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter enhancement New feature request or improvement to existing functionality S-Planned Status: planned by the team, but not in the short term
Projects
None yet
Development

No branches or pull requests

3 participants