개발 도구 설정
Raw이 문서는 synapse-annotator main 브랜치(2026-10-27) 기준입니다.
TypeScript (tsconfig.json)
섹션 제목: “TypeScript (tsconfig.json)”설정 파일은 tsconfig.json 하나입니다.
{ "compilerOptions": { "target": "esnext", "module": "esnext", "strict": true, "jsx": "preserve", "moduleResolution": "node", "experimentalDecorators": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "useDefineForClassFields": true, "sourceMap": true, "baseUrl": ".", "resolveJsonModule": true, "types": ["vite/client", "node", "vitest/globals"], "paths": { "@/*": ["src/*"], "@aa/*": ["src/app/annotator/annotators/audio-annotator/*"], "@app/*": ["src/app/*"], "@assets/*": ["src/assets/*"], "@ia/*": ["src/app/annotator/annotators/image-annotator/*"], "@pa/*": ["src/app/annotator/annotators/pcd-annotator/*"], "@pta/*": ["src/app/annotator/annotators/prompt-annotator/*"], "@services/*": ["src/app/annotator/services/*"], "@shared/*": ["src/app/shared/*"], "@ta/*": ["src/app/annotator/annotators/text-annotator/*"], "@va/*": ["src/app/annotator/annotators/video-annotator/*"] }, "lib": ["esnext", "dom", "dom.iterable", "scripthost"] }, "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"], "exclude": ["node_modules"]}types:vite/client는import.meta.env등 Vite 타입,vitest/globals는 import 없이 쓰는describe·it·expect타입입니다.paths는vite.config.js의resolve.alias와 같은 11개입니다. 별칭을 바꿀 때는 두 파일과vitest.config.js를 함께 고칩니다.type-check(tsc --noEmit)는.ts·.tsx만 검사합니다.include에src/**/*.vue가 있지만tsc는.vue파일을 읽지 않고,vue-tsc는 쓰지 않습니다..vueimport 의 타입은*.vue모듈 선언(shim) 파일로 처리합니다.
ESLint (eslint.config.mjs)
섹션 제목: “ESLint (eslint.config.mjs)”ESLint 9 flat config 입니다. 배열 순서대로 적용되며 뒤 블록이 앞 블록을 덮어씁니다.
| 순서 | 블록 | 대상 | 내용 |
|---|---|---|---|
| 1 | 공통 | **/*.{js,mjs,cjs,ts,vue} |
전역 browser·node, ecmaVersion: 2020, 플러그인 @typescript-eslint·perfectionist, 아래 공통 규칙 |
| 2 | pluginVue.configs['flat/base'] |
.vue |
Vue 파서(vue-eslint-parser)와 기본 규칙만. essential·recommended 프리셋은 쓰지 않습니다 |
| 3 | Vue 덮어쓰기 | **/*.vue |
<script> 파서로 @typescript-eslint/parser, Vue 규칙 조정 |
| 4 | TypeScript | **/*.ts |
@typescript-eslint/parser + project: './tsconfig.json' |
| 5 | eslint-config-prettier |
전체 | Prettier 와 겹치는 서식 규칙을 끔 |
- JS 기본 권장 규칙(
@eslint/js의 recommended)은 켜지 않았습니다. - Prettier 는 ESLint 규칙으로 돌리지 않습니다(
eslint-plugin-prettier없음). 포맷은prettier를 따로 실행합니다(lefthook,prettier스크립트).
공통 규칙
섹션 제목: “공통 규칙”| 규칙 | 설정 |
|---|---|
perfectionist/sort-* 20개 |
error. 정렬 기준은 아래 표 |
padding-line-between-statements |
error. return 앞에 빈 줄 |
no-dupe-class-members |
error |
no-multiple-empty-lines |
error, max: 1 (실제로는 꺼짐, 아래 참고) |
@typescript-eslint/no-explicit-any |
warn |
@typescript-eslint/no-unused-vars |
warn. _ 로 시작하는 인자·변수·catch 변수는 제외 |
@typescript-eslint/explicit-function-return-type, explicit-module-boundary-types, no-non-null-assertion |
off |
perfectionist 공통 설정은 type: 'line-length', partitionByComment: true(주석 줄로 구획을 나누면 구획 안에서만 정렬)입니다.
| 정렬 기준 | 규칙 (perfectionist/ 생략) |
|---|---|
줄 길이순 (line-length) |
sort-imports(명시), sort-array-includes, sort-classes, sort-decorators, sort-enums, sort-exports, sort-heritage-clauses, sort-switch-case, sort-union-types |
알파벳순 (alphabetical) |
sort-interfaces, sort-intersection-types, sort-jsx-props, sort-maps, sort-modules, sort-named-exports, sort-named-imports, sort-object-types, sort-objects, sort-sets, sort-variable-declarations |
Vue 규칙
섹션 제목: “Vue 규칙”| 규칙 | 설정 |
|---|---|
vue/no-unused-components |
warn |
vue/multiline-html-element-content-newline |
error (실제로는 꺼짐, 아래 참고) |
vue/multi-word-component-names, vue/no-v-html, vue/no-multiple-template-root, vue/require-default-prop |
off |
vue/attribute-hyphenation, vue/first-attribute-linebreak, vue/html-closing-bracket-spacing, vue/html-indent, vue/html-self-closing, vue/max-attributes-per-line, vue/singleline-html-element-content-newline |
off |
Prettier
섹션 제목: “Prettier”.prettierrc.json
{ "semi": false, "trailingComma": "none", "bracketSameLine": true, "singleQuote": true, "printWidth": 120}- 플러그인과
overrides는 없습니다..vue는 Prettier 내장 파서로 처리합니다. .prettierignore는public/,dist/,node_modules/,src/assets/, 모든*.json,README.md등을 제외합니다. 로케일 JSON 도 Prettier 대상이 아닙니다.
Git hooks (lefthook)
섹션 제목: “Git hooks (lefthook)”lefthook.yml (포맷·린트 부분)
pre-commit: parallel: false commands: format: glob: 'src/**/*.{js,vue,tsx,ts,jsx}' stage_fixed: true run: node_modules/.bin/prettier --write {staged_files} lint: glob: 'src/**/*.{js,vue,tsx,ts,jsx}' stage_fixed: true run: node_modules/.bin/eslint --fix {staged_files}- 커밋할 때 스테이징된 JS·TS·Vue 파일에 Prettier(
format) → ESLint--fix(lint)를 차례로 실행하고, 고친 내용을 다시 스테이징합니다(stage_fixed). ESLint 오류가 남으면 커밋이 멈춥니다. - lefthook 은
parallel: false일 때 명령을 파일에 적힌 순서가 아니라 이름의 알파벳순으로 실행합니다. 여기서는format이lint보다 앞이라 Prettier 가 먼저 돕니다. - lefthook 기본 glob 매처에서
src/**/*.{...}는src/아래 한 단계 이상 폴더 안의 파일만 잡습니다.src/main.js·src/i18n.js처럼src/바로 아래 파일은 훅의 포맷·린트 대상이 아닙니다(lefthook 1.13.6 으로 확인). - 이 밖에 저장소 내부 문서 사본이 서로 같은지 보는 검사가 하나 더 있습니다.
- 훅은
pnpm install뒤prepare스크립트가lefthook install로 설치합니다(CI 제외).pnpm-workspace.yaml의ignoredBuiltDependencies에lefthook이 있어 패키지 자체의 설치 스크립트는 실행되지 않습니다.
CSS / 스타일링
섹션 제목: “CSS / 스타일링”Tailwind CSS 4 + PostCSS + SCSS 를 씁니다. Bootstrap·BootstrapVue 패키지는 설치하지 않으며, 코드에 남은 Bootstrap 클래스는 자체 호환 SCSS 로 제공합니다(앱 엔트리포인트의 전역 CSS 참고).
postcss.config.js
module.exports = { plugins: [require('@tailwindcss/postcss'), require('autoprefixer')]}Tailwind 진입 CSS (앞부분)
@import "tailwindcss/theme";@import "tailwindcss/utilities";@import './theme-variables.css';
@config "../../../tailwind.config.js";tailwindcss전체가 아니라theme·utilities만 불러옵니다. Preflight(기본 스타일 초기화)를 불러오지 않으므로 기존 스타일이 초기화되지 않습니다.@config로 JS 설정 파일(tailwind.config.js)을 함께 읽습니다.- 같은 파일에서
@theme로 surface·text 의미 색을,@utility로btn-app·focus-ring·card-app같은 공용 유틸리티를 정의합니다. - 클래스 접두사(
prefix)는 쓰지 않습니다.
tailwind.config.js 주요 설정
| 키 | 값 |
|---|---|
content |
./src/**/*.{vue,js,ts,jsx,tsx}, ./public/index.html (뒤 항목은 Webpack 시절 경로로, 지금은 해당 파일이 없습니다) |
darkMode |
'class' |
corePlugins.preflight |
false. Tailwind CSS 4 는 JS 설정의 corePlugins 를 지원하지 않으므로, 실제로 Preflight 를 빼는 것은 위 진입 CSS 입니다 |
theme.extend |
색(primary·secondary·success·danger·warning·info 의 50~900·hover·soft, gray, surface 등)과 textColor·backgroundColor·borderRadius·boxShadow 는 CSS 변수(var(--color-primary) 등)로 참조합니다. spacing과 툴바 크기(height·width·minWidth)는 대부분 고정값입니다(width.toolbar-button 만 var(--toolbar-button-width, 42px)). fontFamily.sans 는 Pretendard. fontSize 키가 두 번 적혀 있어 뒤의 { 'toolbar-label': '0.8rem' } 만 적용되고, 앞의 CSS 변수 기반 글자 크기 설정은 덮어써집니다 |
plugins |
@tailwindcss/forms |