Standardise your npm scripts

"format:all": "prettier '**/*.{js,jsx,ts,tsx,json,md,css}' --write",
"format:check": "prettier '**/*.{js,jsx,ts,tsx,json,md,css}' --check",

Solution

{
"name": "@company/prettier-config",
"version": "1.0.0",
"main": "index.js",
"prettier": "./index.js",
"bin": {
"company-format-check": "bin/format-check.sh",
"company-format-all": "bin/format-all.sh"
},
"dependencies": {
"prettier": "1.19.1"
}
}
module.exports = {
useTabs: false,
tabWidth: 2,
printWidth: 80,
semi: false,
trailingComma: 'all',
bracketSpacing: true,
arrowParens: 'avoid',
singleQuote: true,
}
prettier '**/*.{js,jsx,ts,tsx,json,md,css,yaml}' --check
prettier '**/*.{js,jsx,ts,tsx,json,md,css,yaml}' --write
yarn add @company/prettier-config -D
{
"prettier": "@company/prettier-config",
"scripts": {
"format:check": "company-format-check",
"format:all": "company-format-all"
},
"devDependencies": {
"@company/prettier-config": "1.0.0"
}
}

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store