Plugin Authoring Example
Start a new plugin that exposes one rule.
Steps
- Scaffold the project:bash
npm init -y npm install --save-dev @lapidist/design-lint typescript - Create
index.tswith a rule:tsexport default { rules: [{ name: 'demo/no-raw-colors', create: () => ({}) }] }; - Test it:ts
import { Linter, FileSource } from '@lapidist/design-lint'; import plugin from './index.js'; const linter = initLinter({ plugins: [plugin], rules: { 'demo/no-raw-colors': 'error' } }, new FileSource());
Next steps
Read the plugins guide for a full tutorial.