-
Notifications
You must be signed in to change notification settings - Fork 0
Monaco Editor에 Prettier 포맷터를 통합하여 에디터 내에서 단축키를 통해 코드 포맷팅 기능 추가 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates Prettier code formatting into the Monaco code editor widget, enabling automatic code formatting with a keyboard shortcut.
- Imports Prettier standalone library with Babel and ESTree plugins
- Registers a Monaco document formatting provider that formats code using Prettier
- Adds Cmd+Shift+F keyboard shortcut to trigger code formatting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
기능 추가되면 docs에도 같이 설명 추가하고 이러면 더 조을것 같아요 |
|
@ohah 그럼 settings에 포맷팅 기능 추가되면 docs에 내용 추가할게요! |
* feat: 단축키를 통해 prettier 포맷팅 지원 * fix: format check * chore: javascript/typescript 포맷터 등록 분리 * chore: 등록된 포맷터 컴포넌트 언마운트 시 해제하여 clean up 처리 * chore: 이전에 등록된 포맷터가 남아있는 경우, 먼저 해제하도록 코드 적용
📌 요약
📝 작업 내용
prettier/standalone과 플러그인(babel,estree)을 사용하여 브라우저 환경에서 Prettier 실행registerDocumentFormattingEditProviderAPI를 사용하여 JavaScript 언어에 대한 포맷터 등록Cmd+Shift+F: 문서 전체 포맷팅 실행🔍 스크린샷
2025-11-04.3.15.53.mov
💡 참고 사항