refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
---
|
||||
id: wiki-2026-0508-eslint-plugin-prettier
|
||||
title: eslint-plugin-prettier
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [eslint plugin prettier, prettier-plugin]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [eslint, prettier, formatting, lint, devops]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: javascript
|
||||
framework: eslint
|
||||
---
|
||||
|
||||
# eslint-plugin-prettier
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 Prettier 의 formatting 결과를 ESLint rule 로 노출"**. 매 Prettier 가 보는 차이를 lint error 로 reporting — 매 같은 IDE/CI 에서 lint 와 format 을 한 흐름으로. 2026 현재는 `eslint --fix` integration 보다 **flat config + Prettier 3 + format-only on save** 가 권장.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 동작 원리
|
||||
- `eslint-plugin-prettier` 는 **Prettier 를 ESLint rule 처럼 실행** — file 의 expected output 과 actual content 를 비교해 diff 를 lint error 로 보고.
|
||||
- Rule key: `prettier/prettier` — `--fix` 시 Prettier 가 직접 rewrite.
|
||||
- 항상 `eslint-config-prettier` 와 함께 사용 (ESLint 의 stylistic rules off).
|
||||
|
||||
### 매 2026 권장 stack
|
||||
- **Format**: Prettier 3.x — IDE save 또는 git pre-commit hook 에서 직접 실행.
|
||||
- **Lint**: ESLint 9 flat config — 매 logic / type-aware rules.
|
||||
- **결합**: `eslint-config-prettier` 만 적용 (rule conflict off). `eslint-plugin-prettier` 는 **선택** — CI 에서만 사용 권장.
|
||||
|
||||
### 매 응용
|
||||
1. Monorepo CI 에서 `eslint --max-warnings=0` 으로 format drift 감지.
|
||||
2. Pre-commit `lint-staged` 와 결합해 staged file 만 빠르게 검사.
|
||||
3. Editor 가 Prettier 미설치인 contributor 의 PR 에서 catch.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Flat config (ESLint 9 + Prettier 3, 2026 표준)
|
||||
```js
|
||||
// eslint.config.js
|
||||
import prettierPlugin from 'eslint-plugin-prettier';
|
||||
import prettierConfig from 'eslint-config-prettier';
|
||||
import js from '@eslint/js';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
prettierConfig, // turns off conflicting rules
|
||||
{
|
||||
plugins: { prettier: prettierPlugin },
|
||||
rules: {
|
||||
'prettier/prettier': ['error', { singleQuote: true, semi: true }],
|
||||
},
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
### Recommended preset
|
||||
```js
|
||||
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
|
||||
export default [
|
||||
prettierRecommended, // includes plugin + config + rule
|
||||
];
|
||||
```
|
||||
|
||||
### Pre-commit (lint-staged + husky)
|
||||
```json
|
||||
// package.json
|
||||
{
|
||||
"lint-staged": {
|
||||
"*.{js,ts,tsx}": ["eslint --fix", "prettier --write"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### CI gate
|
||||
```yaml
|
||||
# .github/workflows/lint.yml
|
||||
- run: pnpm prettier --check .
|
||||
- run: pnpm eslint .
|
||||
```
|
||||
|
||||
### Programmatic check
|
||||
```js
|
||||
import { ESLint } from 'eslint';
|
||||
|
||||
const eslint = new ESLint({ fix: false });
|
||||
const results = await eslint.lintFiles(['src/**/*.ts']);
|
||||
const formatter = await eslint.loadFormatter('stylish');
|
||||
console.log(formatter.format(results));
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 매 contributor 가 Prettier 셋업 보장 안 됨 | `eslint-plugin-prettier` 도입 → CI gate |
|
||||
| 매 모두 IDE save-on-format + pre-commit | plugin 없이 `prettier --check` 만 |
|
||||
| Monorepo + 다양한 language | Prettier CLI 직접 + plugin 생략 (속도 ↑) |
|
||||
| Editor lint = error 표시가 필요 | plugin 활성 |
|
||||
|
||||
**기본값**: **`eslint-config-prettier` 만 사용 + Prettier 는 별도 실행**. plugin 은 형식 drift 감지용 CI 에서 한정 적용.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[ESLint]] · [[Prettier]]
|
||||
- 변형: [[eslint-config-prettier]]
|
||||
- 응용: [[lint-staged]] · [[husky]] · [[CI_CD_Pipeline|CI_CD Pipeline]]
|
||||
- Adjacent: [[Code-Quality]] · [[DevSecOps_Framework]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 Prettier output 과 lint output 을 한 reporter 로 통합해야 할 때 — 특히 monorepo CI 에서.
|
||||
**언제 X**: 매 small repo 이고 contributor 가 Prettier IDE plugin 사용. plugin 의 overhead (Prettier 를 매 lint 에서 invoke) 가 불필요.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Stylistic ESLint rule 과 plugin 동시 사용**: `eslint-config-prettier` 미적용 → 무한 충돌.
|
||||
- **`--fix` 의존 only**: editor 가 fix 안 해주면 broken state 유지. Prettier 직접 실행이 빠르고 명확.
|
||||
- **Plugin 으로 모든 file 검사**: 매 large repo 에서 ESLint+Prettier 동시 invoke 는 느림. `lint-staged` 로 scope.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (eslint-plugin-prettier README v5.x, Prettier 3 docs, ESLint 9 flat config docs).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — full content with flat config + 2026 권장 stack |
|
||||
Reference in New Issue
Block a user