Code Monkey home page Code Monkey logo

run-node-formatter's Introduction

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"
  }

run-node-formatter's People

Contributors

cowboyd avatar edm00se avatar marvinjwendt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

run-node-formatter's Issues

[Bug] Fails on linting workflow files

Action fails on linting workflow files.

! [remote rejected] master -> master (refusing to allow an integration to create or update .github/workflows/lint.yml)

Could be fixed by ignoring all workflow files on push (they wouldn't be linted anymore tho)

Probably fix with: git update-index --assume-unchanged <file>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.