-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Adopt Prettier for JavaScript code formatting #1166
Comments
I want a CI check that confirms that files conform to prettier - but only This seems to do the job:
|
This action looks good - tag 3.2 is equivalent to this commit hash: https://github.com/creyD/prettier_action/tree/bb361e2979cff283ca7684908deac8f95400e779 |
Maybe not that action actually - I wanted to use a pre-built action to avoid installing Prettier every time, but that's what it seems to do: https://github.com/creyD/prettier_action/blob/bb361e2979cff283ca7684908deac8f95400e779/entrypoint.sh#L28-L37 |
I think this should work:
I'll use the |
Tests passed in https://github.com/simonw/datasette/runs/1631677726?check_suite_focus=true I'm going to try submitting a pull request with badly formatted JavaScript to see if it gets caught. |
Oops, committed that bad formatting test to |
Wrote a TIL about this: https://til.simonwillison.net/github-actions/prettier-github-actions |
I should configure the action to only run if changes have been made within the |
Hi! I don't think Prettier supports this syntax for globs: Tested it. Apparently, it works as a negated character class in regexes (like micromatch(['static/table.js', 'static/n.js'], ['static/*[!.min].js']);
// result: ["static/n.js"] -- brackets are treated like [!.min] in regexes, without negation |
https://prettier.io/ - I'm going to go with 2 spaces.
The text was updated successfully, but these errors were encountered: