The problem
Small inconsistencies add up. A hard-coded spacing value here, an overridden SWAN class there, a component that was deprecated two releases ago: each one is harmless alone, but together they make VistaPrint’s pages drift apart and make every SWAN upgrade harder. Code review catches some of it, late and inconsistently.
What I built
Two plugins, built from scratch: eslint-plugin-swan for JavaScript and TypeScript, and stylelint-plugin-swan for CSS and SCSS. Their 19 rules flag:
- deprecated components, props and tokens;
- internal design tokens used outside SWAN;
- missing accessibility props on SWAN components;
- styles or class names that override SWAN directly;
- patterns SWAN discourages.
Each rule lives in its own module, so adding a rule doesn’t touch the others, and an automated pipeline releases new versions.
How it fits
The plugins are the early-warning step in how SWAN retires things. A deprecation ships in a minor release, the lint rule flags it in every editor straight away, and a codemod moves teams across before the breaking release. Teams see a deprecation while they’re writing the code, not when an upgrade fails.
Impact
The plugins are recommended for every SWAN project and run in 264 repositories, catching problems in the editor instead of in code review.