steven-tey / precedent

An opinionated collection of components, hooks, and utilities for your Next.js project.

Home Page:https://precedent.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve `format:write` script

andriilive opened this issue · 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 👉🏻 #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"