uilint-semantic
v0.2.159
Published
LLM-powered styleguide checking for UILint
Readme
uilint-semantic
LLM-powered styleguide checking plugin for UILint. Enforces design system consistency using local AI models.
Installation
pnpm add uilint-semanticUsage
Plugin System
The styleguide plugin auto-registers with the UILint plugin registry:
import "uilint-semantic"; // Auto-registers plugin
import { pluginRegistry } from "uilint-core";
const styleguidePlugin = pluginRegistry.get("styleguide");Types
import type { StyleguideState } from "uilint-semantic";Features
- LLM-Powered Analysis: Uses local Ollama models to check code against your styleguide
- Styleguide Enforcement: Validates components match your design system rules
- Progress Tracking: Real-time analysis progress and status
Plugin Definition
The styleguide plugin provides:
Commands
styleguide:check-status- Check styleguide and model availabilitystyleguide:reload- Reload styleguide from disk
Panels
- Styleguide Status Panel: Shows model availability, styleguide status, and analysis progress
Rules
semantic- LLM-powered styleguide analysis rule (category:styleguide)
State
interface StyleguideState {
styleguideLoaded: boolean;
styleguidePath: string | null;
modelAvailable: boolean;
modelName: string | null;
analysisStatus: "idle" | "analyzing" | "complete" | "error";
analysisProgress: { current: number; total: number } | null;
lastAnalysisError: string | null;
analyzedFileCount: number;
issueCount: number;
}Configuration
The semantic rule requires:
- A local Ollama instance running
- A styleguide file at
.uilint/styleguide.md
// eslint.config.mjs
{
rules: {
"uilint/semantic": ["warn"]
}
}WebSocket Messages
The plugin handles these WebSocket message types:
| Message | Direction | Description |
|---------|-----------|-------------|
| styleguide:check | Client→Server | Check styleguide status |
| styleguide:status | Server→Client | Styleguide/model availability |
| styleguide:analysis:progress | Server→Client | Analysis progress update |
| styleguide:analysis:complete | Server→Client | Analysis finished |
| styleguide:analysis:error | Server→Client | Analysis error |
License
MIT
