Automating design system standards enforcement
Shift-left enforcement tooling.
Custom ESLint and Stylelint rules for tokens and APIs, a11y testing with axe, editor and pre-commit hooks, blocking CI gates plus visual regression.
WHAT THIS TESTS Whether you can design defense in depth that gives fast local feedback and a hard CI backstop, rather than relying on humans to remember the rules.
A GOOD ANSWER COVERS Layer enforcement from the inside out. In the editor, ship a shared ESLint and Stylelint config with custom rules: ban raw hex and px where tokens exist, require approved component imports, flag deprecated props, and check API conventions; these show squiggles as the contributor types. Add pre-commit hooks via husky and lint-staged so violations block the commit locally and feedback is instant. Encode accessibility checks with axe-core run inside unit tests and Storybook interaction or a11y tests, plus type-level enforcement through strict TypeScript and exported prop types. In CI, run the identical lint, type, a11y, and unit suites as required status checks, add visual regression with a tool like Chromatik or Playwright snapshots, and block merges on failure. Keep local and CI configs identical to avoid surprises.
COMMON WRONG ANSWERS Relying on manual code review to catch token misuse and a11y issues. Running checks only in CI, so contributors discover problems late. Writing prose guidelines with no automated enforcement. Different rule sets locally versus CI, causing it-works-on-my-machine failures. Ignoring accessibility automation.
LIKELY FOLLOW-UPS How do you write a custom ESLint rule to ban raw colors? What can axe catch automatically and what still needs manual a11y review? How do you keep local and CI configs in sync? How do you avoid slow CI from heavy visual tests?
ONE CONCRETE EXAMPLE A contributor types a raw hex color; a custom ESLint rule flags it in-editor and suggests the matching token. A pre-commit hook blocks the commit until fixed. Their PR runs the same ESLint, axe-based a11y tests, TypeScript check, and visual regression in CI as required checks, so a non-conforming change cannot merge.
Interview question
Why add editor and pre-commit enforcement of design system rules when CI already runs the same checks?
- a.Pre-commit hooks can enforce rules that CI is technically unable to run
- b.Local feedback catches violations instantly instead of after a failed CI runCorrect
- c.CI checks cannot validate accessibility or token usage
- d.Editor rules replace the need for any CI gates
Why? this is the answer
Local checks give immediate feedback and shorten the loop, while CI remains the hard backstop. The other options are false: CI can run these same checks, and local rules complement rather than replace CI gates.
Just read this? Test yourself on what you have been reading.
- #linting
- #ci-cd
- #accessibility
- #automation
- #developer-experience
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles