Hub rules-lit

rules-lit

v3 public Verified

Lit

Lit is a library for building fast, lightweight web components. These rules govern the development of Lit components, ensuring proper lifecycle management, reactive property handling, and accessibility compliance.

@sigmashakeinc 2 pulls 5 rules published Apr 8, 2026 synced Nov 22, 2026 sigmashakeinc/rules/rulesets/rules-lit →
Severity
4 error 1 warn 0 info
demo.cast
Lit is a library for building fast, lightweight web components. These rules govern the development of Lit components, ensuring proper lifecycle management, reactive property handling, and accessibility compliance.

Rules index

5 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

lit

lit-no-event-handler-string error block

Binding user-controlled strings to DOM event handler attributes (onclick=, onerror=, etc.) enables XSS via attribute injection. Use Lit's @event listener syntax: @click=${this._handler} instead.

Rule source requires an active Pro or Enterprise subscription.
lit-no-property-binding-to-js-url error block

Interpolating user-controlled values into href or src attributes can produce javascript: or data: URLs enabling XSS (CWE-83). Validate URLs against an allowlist of safe schemes (https://, /) or use Lit's .property binding with a validated URL object.

Rule source requires an active Pro or Enterprise subscription.
lit-no-unsafe-html error block

unsafeHTML() inserts raw HTML into the DOM, bypassing Lit's built-in XSS protections (CWE-79). Any user-controlled content passed to unsafeHTML() becomes an injection vector. Render user content as text via the normal ${value} binding, or sanitize with DOMPurify before calling unsafeHTML().

Rule source requires an active Pro or Enterprise subscription.
lit-no-unsafe-static warning log

unsafeStatic() and staticHtml() bypass Lit's template caching and injection defenses. Tag names or attribute names from unsafeStatic() can be attacker-controlled if the value is derived from user input. Ensure all arguments are compile-time constants or come from a strict allowlist.

Rule source requires an active Pro or Enterprise subscription.
lit-no-unsafe-svg error block

unsafeSVG() injects raw SVG which can contain <script> elements and event handlers, enabling XSS. Validate and sanitize SVG content server-side before rendering, or use a strict SVG sanitizer like DOMPurify with ALLOWED_TAGS restricted to safe SVG elements.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Nov 22, 2026
Hash
440b64b76c652177ef33dab2b2508b14b360488e4c590a5889b3839af3239758
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-lit/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-lit. The published version only bumps when a maintainer resyncs.

No commit history available.