Lint code against a StyleKit style
stylekit_lint_codeCheck whether code actually follows a style's rules. Use this AFTER generating or editing UI code to verify it matches the style, instead of assuming it does.
Reports forbidden classes with the reason they are banned and a concrete replacement. Understands JSX/HTML class attributes, cn()/clsx() calls, and template literals; variant prefixes (dark:, md:, hover:) are resolved before matching.
Args:
slug (string): style identifier, e.g. "glassmorphism".
code (string): the source to check. JSX/TSX, HTML, or a bare class string.
checkRequired (array of 'button'|'card'|'input', optional): also report required classes the code is missing. Only pass components the code is supposed to contain.
Returns JSON: { slug, ok, violations: [{ className, baseClassName, line, severity, source, rule, reason, fix }], missingRequired, checkedClasses, ruleSources, origin, contentSource, fallbackReason? }. Lint rules come from the same live implementation brief used for generation; its five-minute cache and any bundled fallback are reported separately from content provenance.
Examples:
"does this button match neo-brutalist?" -> slug: "neo-brutalist", code: "", checkRequired: ["button"]
strict (boolean, default false): fail missing required classes in a static component snippet. Required checks cover the whole input, not each element.
status is pass, fail, or inconclusive. Runtime class expressions cannot be fully verified. ok is true only for a conclusive static pass; visual quality still needs review.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Source code or class string to lint | |
| slug | Yes | Style slug, e.g. 'glassmorphism' | |
| strict | No | Fail missing required classes in a static snippet | |
| checkRequired | No | Components to also check for missing required classes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| slug | Yes | ||
| origin | Yes | ||
| status | Yes | ||
| coverage | Yes | ||
| warnings | Yes | ||
| violations | Yes | ||
| ruleSources | Yes | ||
| contentSource | Yes | ||
| checkedClasses | Yes | ||
| fallbackReason | No | ||
| missingRequired | Yes |