Automatically formats your code with your preferred code formatter! :rocket:
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
formatter.yml
file in .github/workflows/
on: push
name: Node Code Formatter
jobs:
lint:
name: Node Code Formatter
runs-on: ubuntu-latest
steps:
- name: Node Code Formatter
uses: MarvinJWendt/run-node-formatter@stable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
format
script, then runs your lint
script.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"
}