JavaScript Formatting & Standard Style
Just a simple wrapper around Prettier & Standard with auto-fix enabled.
Why
- Simplify
package.json
use - Filter non-
js
file extensions fromstandard
, thinksjson
isjs
Getting Started
npm i -D prettier-standard-cli
Deployment
cli
prettier 'styles/*.{json,js}'
standard 'src/*.js'
prettier-standard 'src/**/*.{css,json,js}'
package.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
{
"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
Authors
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
- sheerun/prettier-standard for the insperation