본문으로 건너뛰기
🛠️ToolsShed

Prettier Config Generator

선호하는 코드 형식 옵션을 선택하여 .prettierrc 구성 파일을 생성합니다.

{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": false,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "arrowParens": "always",
  "proseWrap": "preserve",
  "endOfLine": "lf"
}

이 도구 소개

Prettier Config Generator는 Prettier가 지원하는 모든 포매팅 옵션을 외우지 않고도 .prettierrc 파일을 만들 수 있도록 도와줍니다. JavaScript와 TypeScript 프로젝트에서 일관되고 자동화된 코드 포매팅을 설정해 스타일을 두고 다투지 않게 해 주는 흔한 고민을 해결합니다.

세미콜론, 작은따옴표 또는 큰따옴표, 탭 너비, 후행 쉼표, 줄 길이 같은 원하는 옵션을 켜고 끈 뒤, 생성된 .prettierrc를 프로젝트 루트에 그대로 복사하면 됩니다. 새 프로젝트 시작, 팀의 스타일 통일, 신규 기여자 온보딩에 모두 적합합니다.

팁: 설정 파일을 저장소에 커밋해 두면 팀원 모두가 동일하게 코드를 포매팅하고 diff도 깔끔하게 유지됩니다. 모든 처리는 브라우저에서 로컬로 실행되므로 설정과 코드가 기기 밖으로 나가지 않습니다.

자주 묻는 질문

코드 구현

import json

# Generate .prettierrc configuration
config = {
    "printWidth": 80,
    "tabWidth": 2,
    "useTabs": False,
    "semi": True,
    "singleQuote": False,
    "trailingComma": "es5",
    "bracketSpacing": True,
    "arrowParens": "always",
    "endOfLine": "lf"
}

with open(".prettierrc", "w") as f:
    json.dump(config, f, indent=2)

print("Generated .prettierrc:")
print(json.dumps(config, indent=2))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.