Read-only mining codemod that detects direct DOM manipulation patterns in AngularJS source that block a clean migration to Angular's template/Renderer2 model, and emits dom_mutation metrics. No files are written to the target repo.
What it detects
pattern_kind
Detected via
Risk
Automation
jquery
$(...) / jQuery(...) calls and $.xxx / jQuery.xxx member access
high
manual
angular_element
angular.element(...) calls and element.xxx jqLite member access (link/directive element param)
high
partial
document
document.xxx member access
medium
partial
compile
$compile identifier usage (DI param, direct call, or member access target)
critical
manual
native_dom
.querySelector, .getElementById, .innerHTML, .appendChild member access on any object
high
manual
A single line can match more than one pattern (e.g. angular.element(document.body) reports both angular_element and document) — each is a distinct migration signal and is emitted as its own metric row.
# Install from registry
codemod run angularjs-dom-mutation
# Or run locally
codemod run -w workflow.yaml
Development
bash
# Test the transformation
pnpm test
# Type-check
pnpm run check-types
# Validate the workflow
codemod workflow validate -w workflow.yaml
# Publish to registry
codemod login
codemod publish
License
MIT
Ready to evolve your codebase?
Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.