@tank/ast-linter-codemod

Installation
SKILL.md

AST Linters, Codemods, and Migration Tools

Build linters that catch bugs and fix them automatically. Write codemods that migrate entire codebases. Ship migration tools that handle edge cases.

Core Philosophy

  1. Parse, don't regex. Text manipulation breaks on edge cases. AST tools understand code structure — template literals, JSX, decorators, and all.
  2. Every lint rule deserves a fix. A rule without auto-fix is a rule that creates manual work. Ship the fix with the rule.
  3. Test with fixtures, not assertions. Input file → expected output file. Fixtures are readable, diffable, and catch regressions that assertions miss.
  4. Analyze first, transform second. Collect all findings before mutating. AST manipulation invalidates nodes — iterating and mutating simultaneously causes forgotten-node bugs.
  5. Idempotent transforms only. Running a codemod twice must produce the same output. If it doesn't, the codemod has a detection gap.
Installs
–
GitHub Stars
1
First Seen
–
@tank/ast-linter-codemod — tankpkg/packages