https://github.com/MarvinJWendt/run-node-formatter
  
  
    Automatically formats your code with your preferred code formatter! :rocket: 
    https://github.com/MarvinJWendt/run-node-formatter
  
action ci formatter github-action github-actions linter node prettier standard xo
        Last synced: 7 months ago 
        JSON representation
    
Automatically formats your code with your preferred code formatter! :rocket:
- Host: GitHub
 - URL: https://github.com/MarvinJWendt/run-node-formatter
 - Owner: MarvinJWendt
 - License: mit
 - Archived: true
 - Created: 2019-09-07T01:26:46.000Z (about 6 years ago)
 - Default Branch: master
 - Last Pushed: 2019-11-22T02:42:05.000Z (almost 6 years ago)
 - Last Synced: 2025-03-18T14:51:33.606Z (8 months ago)
 - Topics: action, ci, formatter, github-action, github-actions, linter, node, prettier, standard, xo
 - Language: Shell
 - Homepage:
 - Size: 78.1 KB
 - Stars: 37
 - Watchers: 1
 - Forks: 8
 - Open Issues: 4
 - 
            Metadata Files:
            
- Readme: README.md
 - Contributing: CONTRIBUTING.md
 - Funding: .github/FUNDING.yml
 - License: LICENSE
 - Code of conduct: CODE_OF_CONDUCT.md
 
 
Awesome Lists containing this project
- awesome-actions - Node.js - Automatically run the `format` and/or `lint` script used by the package
 - fucking-awesome-actions - Node.js - Automatically run the `format` and/or `lint` script used by the package
 - awesome-workflows - Node.js - Automatically run the `format` and/or `lint` script used by the package
 
README
          # Node Code Formatter
[](https://github.com/marketplace/actions/node-code-formatter)
[](https://github.com/MarvinJWendt/run-node-formatter/blob/master/LICENSE)
[](https://github.com/MarvinJWendt/run-node-formatter/issues)
[](https://github.com/MarvinJWendt/run-node-formatter/stargazers)
> Automatically formats your code!
## Automatically format pull requests
_Never tell your users to format their code, as we do it on the fly!_

## Usage :pencil2:
**For a more detailed installation guide look into our [wiki](https://github.com/MarvinJWendt/run-node-formatter/wiki)**
1. Create a `formatter.yml` file in `.github/workflows/`
2. Paste this code into the file:
```yml
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 }}
```
3. Commit the file :twisted_rightwards_arrows:
## Features :sparkles:
1. First runs your `format` script, then runs your `lint` script.
2. Works on: 
   1. New commit
   2. Internal branches
   3. Internal pull requests
3. Report errors
## Setup formatter scripts :clipboard:
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!**
### StandardJS
```json
...
"scripts": {
    "format": "standard --fix"
  }
```
### Prettier
```json
...
"scripts": {
    "format": "prettier --write"
  }
```