Expand description
Markup CSS-class reference scanning and class-name similarity.
Supports the fallow health --css class-reach candidates (the CSS analogue
of unresolved-import). scan_markup_class_tokens pulls the STATIC class
tokens out of class / className attributes across every markup surface
fallow visits (JSX/TSX, HTML, Vue/Svelte/Astro), and flags whether the file
also constructs classes DYNAMICALLY (clsx(...), `btn-${x}`,
:class, spread props), which downstream consumers use to abstain.
The scanner is intentionally regex-based and conservative: it only collects tokens from a fully-static quoted attribute value, and treats anything that could be an interpolation as a dynamic signal rather than a token. It never tries to evaluate a dynamic expression.
Structs§
- Markup
Class Scan - The result of scanning one markup source for class references.
- Markup
Class Token - A static class token referenced in markup, with the 1-based line it sits on.
Functions§
- is_
edit_ distance_ one - True when
aandbdiffer by exactly one single-character edit (one substitution, insertion, or deletion). Equal strings return false. Runs in O(min(len)) without building a full edit-distance matrix. - is_
typo_ edit - True when
definedis a likely TYPO target fortoken: exactly one edit apart AND that edit is a believable mistake, not a deliberate naming variation. This is stricter thanis_edit_distance_onebecause real codebases are full of one-edit class pairs that are NOT typos: - scan_
markup_ class_ tokens - Scan a markup source for static class tokens and a dynamic-construction flag.