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 { createLinter, createNodeEnvironment } from '@lapidist/design-lint'; import plugin from './index.js'; const config = { plugins: [plugin], rules: { 'demo/no-raw-colors': 'error' } }; const linter = createLinter(config, createNodeEnvironment(config));
Next steps
Read the plugins guide for a full tutorial.