precedent icon indicating copy to clipboard operation
precedent copied to clipboard

Improve `format:write` script

Open andriilive opened this issue 2 years ago • 0 comments

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"

andriilive avatar Dec 28 '23 05:12 andriilive