Run this line in the terminal of your IDE
npm install -D prettier
Create a Prettier configuration file and save it as .prettierrc
in the root of the workspace.
{
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true,
"endOfLine": "crlf",
"trailingComma": "es5",
"semi": true,
"overrides": [
{
"files": "*.less",
"options": {
"singleQuote": false
}
}
]
}
Add the line below, under "scripts": {
in the file package.json
"prettier": "prettier --write ."
Run for files
**/*.{js,ts,jsx,tsx,html,less,css,json,cjs,cts,mjs,mts,vue,astro}