Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-22T02:42:05.000Z (about 5 years ago)
- Last Synced: 2024-10-14T02:47:16.191Z (3 months ago)
- Topics: action, ci, formatter, github-action, github-actions, linter, node, prettier, standard, xo
- Language: Shell
- Homepage:
- Size: 78.1 KB
- Stars: 36
- Watchers: 2
- 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
[![GitHub Action](https://img.shields.io/badge/-GitHub_Action-black?logo=github&style=flat-square)](https://github.com/marketplace/actions/node-code-formatter)
[![GitHub license](https://img.shields.io/github/license/MarvinJWendt/run-node-formatter?style=flat-square)](https://github.com/MarvinJWendt/run-node-formatter/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/MarvinJWendt/run-node-formatter)](https://github.com/MarvinJWendt/run-node-formatter/issues)
[![GitHub stars](https://img.shields.io/github/stars/MarvinJWendt/run-node-formatter?style=flat-square)](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!_
![image](https://user-images.githubusercontent.com/31022056/64829627-6457d300-d5cd-11e9-9bc0-6a35d095ec64.png)
## 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"
}
```