Just install StandardJS via npm install standard --save-dev
.
Then run through the rules just to quickly get a feel of it.
Finally, create a script in your package.json to run StandardJS, when you need it:
{
"scripts": {
"check": "standard"
}
}
...then you can run it via npm run check
To provide a quick way to yourself to fix most coding style typos, add a fix script to your package.json:
{
"scripts": {
"check": "standard",
"fix": "standard --fix"
}
}
...and run via npm run fix
To get a more nicer representation of coding style errors, install snazzy via npm install snazzy --save-dev
, then modify your package.json like so:
{
"scripts": {
"check": "standard --verbose | snazzy",
"fix": "standard --fix"
}
}