"매 AST-level 의 transform — 매 sed 의 X, 매 syntax-aware 의 mass-edit". 매 IDE refactor (Rename · Extract) 의 80년대 Smalltalk 의 root, 2026 의 LLM-augmented codemod (Claude Opus 4.7 + ast-grep) 의 mainstream.
매 핵심
매 3 tier 의 tool
IDE-builtin: IntelliJ · VS Code · Rider — 매 single-file 의 dominant.
Codemod: jscodeshift · ts-morph · comby · ast-grep — 매 cross-cutting mass change.
LLM-driven: Claude Code · Cursor · GitHub Copilot Workspace — 매 semantic-aware 의 modernization.
매 refactor 종류
Rename (symbol-aware).
Extract function/variable/component.
Inline.
Move (file/module).
Change signature.
Convert (e.g. var → const, function → arrow).
매 응용
매 framework migration (Vue 2 → Vue 3, React class → hook).
exportdefaultfunctiontransformer(file,api){constj=api.jscodeshift;constroot=j(file.source);root.find(j.ObjectExpression).filter(p=>p.node.properties.some(pr=>pr.key?.name==="data")).forEach(path=>{// emit setup() function with refs
// ...
});returnroot.toSource();}
언제: 매 semantic refactor (class→hook, callback→async/await), 매 deterministic rule 의 hard 의 case.
언제 X: 매 mechanical rename 의 case — IDE 가 cheaper · safer. LLM 의 hallucination risk 의 require code review.
❌ 안티패턴
Regex-only refactor: 매 string match 의 false positive (comment · string literal).
Test 없음 refactor: 매 mass codemod 의 test suite 의 gate 의 require.
PR 의 single huge codemod: 매 review 의 X — file-by-file commit 의 split.
LLM output 의 blind merge: 매 type-check + test 의 gate 의 mandatory.
🧪 검증 / 중복
Verified (ts-morph docs, Meta jscodeshift, comby.dev, ast-grep.github.io, Anthropic Claude API docs).