@contractspec/eslint-plugin-design-system
v3.7.6
Published
Design-system ESLint rules (prefer-design-system) for LSSM apps
Readme
@contractspec/eslint-plugin-design-system
Design-system enforcement rules for LSSM apps. Ships:
prefer-design-system: auto-rewrites known@contractspec/lib.ui-kit-webform/control imports to@contractspec/lib.design-systemand flags intrinsic layout/form elementsno-intrinsic-typography: flag raw headings/paragraph/spans; use DS typography primitivesdesign-import-boundary: block forbidden design imports (default: native ui-kit in web)localAllowPatternsoption (prefer-design-system): allow local/relative imports (shadcn-style) to bypass DS replacement so teams can copy/paste components.
configs.recommended enables all of the above.
Usage:
import dsPlugin from '@contractspec/eslint-plugin-design-system';
export default [
dsPlugin.configs.recommended,
// or customize
// {
// plugins: { 'design-system': dsPlugin },
// rules: {
// 'design-system/prefer-design-system': [
// 'error',
// {
// intrinsicDisallowList: ['div', 'button'],
// localAllowPatterns: ['^\\./components', '^@/components'],
// },
// ],
// 'design-system/no-intrinsic-typography': 'error',
// 'design-system/design-import-boundary': 'error',
// },
// },
];