An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


JavaScript Formatting & Standard Style Wrapper


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