@magic/format
@magic/format
run prettier and format your code.
install
be in a nodejs project.
npm i --save-dev --save-exact @magic/format
Usage
npm run scripts
Add the @magic/test bin scripts to package.json
{
"scripts": {
"format": "f -w",
"format:check": "f"
},
"devDependencies": {
"@magic/format": "0.0.1"
}
}
then use the npm run scripts
npm run format
npm run format:check
cli
// first install globally
npm i -g @magic/format
// check formatting using prettier but do not write
// prettier --list-different
f
// format files using prettier
// prettier --write
f -w