Framework Integrations
This guide targets front-end developers integrating design-lint into specific ecosystems.
Table of contents
React
Lint React components and CSS-in-JS files:
npx design-lint "src/**/*.{ts,tsx,css}"// designlint.config.json
{
"rules": { "design-system/component-usage": "error" }
}Component-oriented design-system rules are policy-driven. Configure substitutions, component lists, package scopes, or import origins to match your design system.
Inline style support in TSX/JSX covers string attributes and object-literal expressions with literal string/number values. Dynamic style expressions are not normalized into CSS declarations.
Tagged template analysis is strict: only configured template roots are parsed as CSS declarations. Extend templateTags in config when your project uses custom helpers.
Next.js
Run design-lint alongside next lint or as a separate script. The example below enforces token usage in pages and components:
npx design-lint pages componentsVue
.vue single‑file components are parsed so template, script, and style blocks are checked automatically.
Supported template style forms:
style="color: #fff; padding: 4px;":style="{ color: '#fff', padding: 4 }":style="[{ color: '#fff' }, { padding: 4 }]"- Multiline object/array style bindings using
:style v-bind:style="..."expressions, including conditional object/array results
npx design-lint "src/**/*.vue"Svelte
Svelte components include <script> and <style> sections. design-lint understands both:
npx design-lint src/routesCurrently supported file types
design-lint currently supports these file extensions:
tstsxmtsctsjsjsxmjscjscssscsssass(recognized, reported as unsupported indented syntax viaparse-error)lessvuesvelte
Other environments
Angular, Astro, and static HTML files are not linted directly.
If you use Angular or Astro, lint the supported TypeScript/JavaScript and stylesheet files in those projects.
Examples:
Angular app code and styles:
bashnpx design-lint "src/**/*.{ts,js,css,scss,less}"Astro scripts and styles:
bashnpx design-lint "src/**/*.{ts,tsx,js,jsx,css,scss,less}"
For static HTML projects, target the referenced CSS files or any supported script/style sources instead of .html files.