Prettier
Installation
Section titled “Installation”See the official documentation.
npm i prettieryarn add prettierpnpm add prettierbun add prettierSettings
Section titled “Settings”These are basic prettier settings (.prettierrc.json).
{ "$schema": "https://json.schemastore.org/prettierrc.json", "arrowParens": "avoid", "printWidth": 80, "semi": false, "singleQuote": true, "tabWidth": 2, "trailingComma": "all"}Create an ignore file (.prettierignore):
builddistcoverageanalysisand here is a script to run prettier on a javascript project:
# File: package.json
"format": "prettier \"./**/*.{html,css,js,jsx,ts,tsx,md,mdx,json}\" --write --cache --log-level=warn",More CLI docs
Integration with a linter