-
Notifications
You must be signed in to change notification settings - Fork 32
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
adds skipPrettier and self closing #57
Conversation
@tylerturdenpants does this solve https://github.com/rajasegar/ember-angle-brackets-codemod/issues/54? I think we need prettier/prettier#6186 for that which I don't believe has been released yet |
Likewise, does it actually solve the other issues? As far as I can tell, disabling prettier introduces a bunch of new formatting issues. Eg: {{admin/about-auto-resizing-textarea-component
text=editableBiography
placeholderText='Say hi and help people get to know you by sharing one thing you care about'
noDataText='Introduce yourself'
maxLength=maxBiographyLength
textareaClasses=editableBioTextClasses
editableMode=editableMode
error=biographyError
displayText=model.profile.biography
}} becomes: <Admin::AboutAutoResizingTextareaComponent @text={{editableBiography}} @placeholderText="Say hi and help people get to know you by sharing one thing you care about" @noDataText="Introduce yourself" @maxLength={{maxBiographyLength}} @textareaClasses={{editableBioTextClasses}} @editableMode={{editableMode}} @error={{biographyError}} @displayText={{model.profile.biography}} /> |
@GavinJoyce I think it "almost solves" these issues. The main focus was to give the ability to opt-out of prettier. I can rename the title and remove the description. The other thing is that the PR use glimmer-syntax to correctly print self closing tags. If this is merged, how should we highlight the changes? Let me know what you think |
I might be wrong, but this seems to swap one bunch of formatting problems for another. I think it's fine to add a
A note in the readme seem fine, were you thinking about doing something else? |
You're definitely right. Its seems more like a "pick your poison" for formatting. Similarly to what you said, both approaches requires manual fixing. I'll update the README to reflect and submit for your review again. Thanks! |
@GavinJoyce I think the option of being able to disable prettier in this PR has some value. I have removed the verbiage of keeping white space. Do we want to merge? |
```js | ||
{ | ||
"helpers": [], | ||
"skipPrettier": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, instead of a boolean, it would be better to add a formatter
option whose possible values can be prettier
(the default) and none
? That would allow us the option of adding a new formatter (eg. ember-template-recast
or prettier-experimental
) in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. I'll implement that.
Can we merge this? theres quite a few problems with the formatting. I don't understand why these are grouped together anyway? If people want formatting they would just run the formatter… |
Sorry @atomkirk. Skipping Prettier and Closing elements kinda go hand in hand, disabling Prettier wont give you closing tags, so that needed to be addressed as part of the opt in/out A few of the contributors have dropped off, so the man power has been severely reduced. A majority of the effort has gone into #97 which will keep a huge percentage of the original whitespacing in place. I'm 2 failing test away from releasing if you would like to lend me a hand. |
cool. I'll try to help. But why is formatting wrapped into this codemod at all? Why not just leave the formatting as-is. Also, an earlier handlebars lint config that was the default when we upgraded ember told us to remove |
So if you were to run this codemod without the formatters on your templates, the templates would change to such a degree that it most likely would be undesirable. The formatters were an attempt to get templates back to something recognizable. This is where As far as your second question in regards to |
Disables Prettier completely. An alternative way to format the output of the codemod where in most cases "white space" is preserved. Uses the latest
glimmer/syntax
to apply selfClosing tags when an element is not in block form.