https://github.com/willfarrell/prettier-standard
Just a simple wrapper around Prettier & Standard with auto-fix enabled.
https://github.com/willfarrell/prettier-standard
prettier-js standard-js
Last synced: 5 months ago
JSON representation
Just a simple wrapper around Prettier & Standard with auto-fix enabled.
- Host: GitHub
- URL: https://github.com/willfarrell/prettier-standard
- Owner: willfarrell
- License: mit
- Archived: true
- Created: 2018-04-23T01:03:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T23:27:25.000Z (over 4 years ago)
- Last Synced: 2024-12-17T10:45:10.874Z (about 1 year ago)
- Topics: prettier-js, standard-js
- Language: Shell
- Homepage:
- Size: 412 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JavaScript Formatting & Standard Style
Just a simple wrapper around [Prettier](https://prettier.io/) & [Standard](https://standardjs.com/) with auto-fix enabled.
## Why
- Simplify `package.json` use
- Filter non-`js` file extensions from `standard`, thinks `json` is `js`
## Getting Started
```bash
npm i -D prettier-standard-cli
```
## Deployment
### cli
- `prettier 'styles/*.{json,js}'`
- `standard 'src/*.js'`
- `prettier-standard 'src/**/*.{css,json,js}'`
### package.json
```json
{
"devDependencies": {
"lint-staged":"*",
"husky":"*",
"prettier-standard-cli":"*"
},
"scripts": {
"precommit":"lint-staged",
"lint": "prettier-standard 'src/**/*.{css,json,js}'",
},
"lint-staged": {
"src/**/*.{css,json,js}": [
"prettier-standard",
"git add"
]
}
}
```
### package.json standalone equivalent
```json
{
"devDependencies": {
"lint-staged":"*",
"husky":"*",
"prettier":"*",
"standard":"*"
},
"scripts": {
"precommit":"lint-staged",
"lint": "prettier --write --loglevel warn 'src/**/*.{css,json,js}' && standard --fix 'src/**/*.js'",
},
"lint-staged": {
"src/**/*.{css,json}": [
"prettier --write",
"git add"
],
"src/**/*.js": [
"prettier --write",
"standard --fix",
"git add"
]
}
}
```
## Built With
- [Prettier](https://prettier.io/)
- [Standard](https://standardjs.com/)
## Authors
- [willfarrell](https://github.com/willfarrell/)
## License
This project is licensed under the MIT License - see the LICENSE file for details
## Acknowledgments
- [sheerun/prettier-standard](https://github.com/sheerun/prettier-standard) for the insperation