Prettier
Installation
npm install --save-dev prettier
npm i -D prettier
Configuration
Format
Example
{
"semi": true,
"singleQuote": false
}
Options
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"parser": "babel"
}
ESLint
- not recommended
- https://prettier.io/docs/en/integrating-with-linters.html
- ๋จ์ :
- ํธ์ง๊ธฐ์ ๋ง์ ๋นจ๊ฐ์ ๊ตฌ๋ถ๊ตฌ๋ถํ ์ ์ด ์๊ฒจ ์ง์ฆ์ด ๋ฉ๋๋ค. Prettier๋ ํฌ๋งทํ๋ ๊ฒ์ ์์ด๋ฒ๋ฆฌ๊ฒ ๋ง๋ค์ด์ค๋๋ค.
- Prettier๋ฅผ ์ง์ ์คํํ๋ ๊ฒ๋ณด๋ค ๋๋ฆฝ๋๋ค.
- ๊ทธ๊ฒ๋ค์ ์ฝ๋๊ฐ ๊นจ์ง ์ ์๋ ๊ฐ์ ์ ์ธ ๊ณ์ธต์
๋๋ค.
Ignore
.prettierignore
in project root
ref