
Javascript Style Guide
https://github.com/airbnb/javascript
위 링크는 airbnb에서 작성한 Javascript Style Guide입니다. 아직 본적이 없다면 천천히 내용을 보면 도움이 됩니다.
Prettier settings
prettier : https://pish.tistory.com/21
Formatter 설정 샘플 입니다.
Key
|
Value | is default? | Description |
semi
|
true
|
default
|
세미콜론 사용 여부
|
singleQuote
|
true |
single 쿼테이션 사용 여부
|
|
printWidth
|
80 |
줄 바꿈 할 폭 길이
|
|
trailingComma
|
true |
default
|
여러 줄을 사용할 때, 후행 콤마 사용 방식
|
tabWidth
|
2 |
default
|
탭 너비
|
arrowParens
|
always
|
default
|
화살표 함수 괄호 사용 방식
|
실제로 코드에 적용할 설정
default 설정을 제외하고 나면, 설정파일에 적용해야 할 내용은 아래 두개가 남게 됩니다.
ex) .prettierrc
{
"singleQuote": true,
"printWidth": 80
}
개발툴에서 설정해야할 내용
- prettier 설치
- 설정 파일 저장 (.prettierrc)
- 저장시 자동정렬 on
간단 한 설정이지만, 매우 유용합니다.
'Program > Front-end' 카테고리의 다른 글
mobile에서 textarea 자동줌 해결 with 1rem 16px (0) | 2022.12.25 |
---|---|
web3 개발자가본 SSR vs CSR (3) | 2022.12.24 |
listitem [Markdown 다루기 with Marked, Tailwind CSS] (0) | 2022.12.22 |
prettier.io (0) | 2022.12.17 |
Stack Overflow Trends [ vue.js vs react] (0) | 2022.12.16 |
댓글