-
Notifications
You must be signed in to change notification settings - Fork 5
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
Prettier formatting #550
Prettier formatting #550
Conversation
Awesome, this will make working in this repository much smoother. Will try later. |
What settings would you prefer in the
Additionally, looks like the Prettier extension does the following by default, so it would be good to write them out in the config file so we don't get surprised later:
Which line length do you prefer? Looks like prettier enforces 80 by default. This is of course a safe default, but we could also allow for 100 or 120 if we prefer. Should we continue using the editorconfig file, or remove it and only use prettierrc? Prettier is expected to understand the editorconfig file, and should override them with those in prettierrc in case of double definitions. |
@juho-kettunen-nc I added explicit configs |
Thanks, I like these settings. What about you @henrinie-nc ? |
And @NC-jsAhonen , do you have additional settings in mind, or how do you like these proposed settings? |
I tested the new settings on the file
I liked 100 chars per line, as in the latest commit. |
I would go with the defaults in order to avoid further discussions about the settings and endless fine tuning. :) |
644ba62
to
ddf7e3c
Compare
Lets configure prettier to format only ts and tsx files and reformat the project. |
f6aabf2
to
bad177c
Compare
.vscode/settings.json
Outdated
@@ -0,0 +1,8 @@ | |||
{ |
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.
Maybe add this as an example file like https://github.com/City-of-Helsinki/mvj-ui/blob/develop/.vscode/launch.example.json
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.
Done
This works for me, it ignores both your prettier formatting and Robert's typescript conversion, but only when the ignored commit is NOT the first commit of that line's timeline. For example, line 9 of |
bad177c
to
f2dfd25
Compare
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.
good to go
982e169
to
c9e5c9d
Compare
In some places, the code formatting is a bit off, and some rows are very difficult to read because they are so long.
These changes enable format-on-save feature on mvj-ui repo according to prettier defaults. Please try and see if it works for you, and suggest any changes that come to mind.
It might be necessary to format the whole repo, but I haven't done it yet for this PR yet.
Please test ignoring Robert's "initial to typescript conversion" by running
to set the ignore file in your local git settings, and restarting VSCode. I couldn't make it to work, but perhaps you can.