Automatically formats your code!
Never tell your users to format their code, as we do it on the fly!
For a more detailed installation guide look into our wiki
- Create a
formatter.ymlfile in.github/workflows/ - Paste this code into the file:
on: pushname: Node Code Formatterjobs:
lint:
name: Node Code Formatterruns-on: ubuntu-lateststeps:
- name: Node Code Formatteruses: MarvinJWendt/run-node-formatter@stableenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- Commit the file 🔀
- First runs your
formatscript, then runs yourlintscript. - Works on:
- New commit
- Internal branches
- Internal pull requests
- Report errors
Simply put your code formatter into a script named format or lint in your package.json (Yarn only supports a lint script at the moment).
Make sure that your code formatter is a dependency of your module!
..."scripts": {
"format": "standard --fix"
}..."scripts": {
"format": "prettier --write"
}