precedent
precedent copied to clipboard
Improve `format:write` script
Current format:write script command code violates DRY principles 😿
An example of duplicated prettier command code from package.json:
"format": "prettier \"**/*.{css,js,json,jsx,ts,tsx}\"",
"format:write": "prettier --write \"**/*.{css,js,json,jsx,ts,tsx}\""
Improved script 👉🏻 https://github.com/steven-tey/precedent/pull/76
Common example
"format": "prettier \"**/*.{css,js,json,jsx,ts,tsx}\"",
"format:write": "npm run format -- --write"
Prettier with --cache
"format": "prettier --cache \"**/*.{css,js,json,jsx,ts,tsx}\"",
"format:write": "npm run format -- --write"