일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- css instead of js
- 프로젝트
- importOrder
- 클린코드
- git hooks
- prettier 자동화
- IDL attributes
- 협업
- 유틸함수
- chromatic
- 자바스크립트
- eslint 자동화
- 우아한테크코스
- vscode
- 카페인
- import정리
- CSS
- react
- 프로젝트 카페인
- 성능 베이스캠프
- webpack
- JavaScript
- Husky
- 우테코
- 이슈번호자동화
- string-width
- 크로마틱
- storybook
- eslint에러 자동fix
- 클로저
- Today
- Total
목록코딩/사소한 꿀팁 (3)
FEB:)DAIN

ctrl + shift + p (windows) / command + shift + p (mac)를 눌러 User Settings (JSON) 파일을 연다. 그리고 editor.codeActionsOnSave에 "source.removeUnusedImports": true를 추가해주면 끝이다! // settings.json { ... "editor.codeActionsOnSave": { ... "source.removeUnusedImports": true // ✨추가! }, }

예를 들어, type import를 했을 때 `import type { Type } from`이 아니라 `import { Type } from`을 하면 오류가 나도록 eslint rule 설정했다고 하자. // .eslintrc { ... rules: { ... 'react/self-closing-comp': ['error', { component: true, html: true }], '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports', }, ], }, 오류가 났을 때 직접 type을 추가해 주는 것보다 파일 저장을 할 때마다 자동으로 type이 추가되면 작업 속도가 엄청 증가하게 된다. 만약 저장을 했을 때..

if (isOpen) { document.body.style.overflow = "hidden"; } else { document.body.style.overflow = "auto"; } 자바스크립트로는 이렇게 모달 상태가 open이면 document.body.style.overflow = "hidden"; 을 함으로써 스크롤을 막을 수 있다. 하지만 자바스크립트 없이 CSS로만 똑같은 기능을 구현할 수 있다. /* dialog 태그를 사용하고 .showModal() 메서드를 통해 dialog를 열었을 경우 */ body:has(dialog[open]) { overflow: hidden; } /* 모달에 클래스를 넣어 사용할 경우 */ body:has(.modal-open) { overflow: hidd..