-
Notifications
You must be signed in to change notification settings - Fork 62
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
chore: add automatic font generation and fix VSCode settings #893
Conversation
@@ -1,6 +1,5 @@ | |||
// Place your settings in this file to overwrite default and user settings. | |||
{ | |||
"editor.formatOnSave": false, |
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.
This is unrelated but could we remove this? I am not sure I see value in this. format on save override that is stated below never works for me so I always end up removing it while working on the project and it all seems fine.
'./package.json', | ||
prettier.format(JSON.stringify(currentConfiguration), { | ||
...prettierConfig, | ||
parser: 'json-stringify', |
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.
Which exactly rules are applied here? I am wondering what is there on top of JSON.stringify(..., null, 2)
.
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.
I am pretty sure the only config being passed to prettier ends up being singleQuote: true
and this gets ignored for JSON, the rest (i.e. space size 2) I assume are the prettier defaults so yeah it'd be the same as this.
So it ends up tied to our prettier config (and we have nearly nothing there so... this should be default prettier) so it just stays consistent with any style rules for our prettier
formatter. This way if someone autoformats the file using VSCode there won't be inconsistencies.
A bit late to the party, but I'm not a huge fan of including prettier into the font generation script. Instead, my suggestion would be to invoke it in the package.json script like: "generate-icon-font": "ts-node ./scripts/generate-icon-font.ts && prettier --write package.json",
// or
"generate-icon-font": "ts-node ./scripts/generate-icon-font.ts && reformat", That way we keep the script less tied to the tooling we're using and any changes we decide to make to the way we format code would be confined to package.json and not some random scripts all over the repo. It's not a blocker and not something I necessarily feel we should fix now that the PR is merged, but might be something to consider. |
This just improves the icon generator script by making it automatically modify the
package.json
with the new icon configuration.