Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NodeCodeFormatter/run-node-formatter

Repository files navigation

Node Code Formatter

GitHub Action GitHub license GitHub issues GitHub stars

Automatically formats your code!

Automatically format pull requests

Never tell your users to format their code, as we do it on the fly!

image

Usage ✏️

For a more detailed installation guide look into our wiki

  1. Create a formatter.yml file in .github/workflows/
  2. Paste this code into the file:
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 }}
  1. Commit the file πŸ”€

Features ✨

  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 πŸ“‹

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

...
"scripts": {
 "format": "standard --fix"
 }

Prettier

...
"scripts": {
 "format": "prettier --write"
 }

About

Automatically formats your code with your preferred code formatter! πŸš€

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

Contributors

Languages

  • Shell 86.3%
  • Dockerfile 13.7%

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /