Hub rules-svelte

rules-svelte

v3 public Verified

Svelte

Svelte is a framework that compiles UI components into highly efficient imperative code. These rules govern store management and idiomatic Svelte patterns for AI-assisted development.

@sigmashakeinc 2 pulls 7 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-svelte →
Severity
3 error 4 warn 0 info
demo.cast
Svelte is a framework that compiles UI components into highly efficient imperative code. These rules govern store management and idiomatic Svelte patterns for AI-assisted development.

Rules index

7 governance rules

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

svelte

svelte-block-unsafe-patterns warning ask

Potentially unsafe pattern detected in svelte code: "{@html ". Review the use case — this may indicate a security risk, a deprecated API, or a misconfiguration. Confirm the write is intentional.

Rule source requires an active Pro or Enterprise subscription.
svelte-deny-eval-reactive error block

RISK: eval() or new Function() inside a Svelte reactive statement ($:) re-executes on every dependency change — any user-controlled value flowing into it is a persistent XSS/code-injection vector. FIX: Remove eval/Function; use a static lookup table or JSON.parse() instead.

Rule source requires an active Pro or Enterprise subscription.
svelte-deny-html-user-content error block

RISK: {@html} with user-controlled props/params/formData is a direct XSS sink (CWE-79) — Svelte does not sanitize {@html}. FIX: Sanitize with DOMPurify before passing to {@html}, or render as plain text (just use {variable} which Svelte auto-escapes).

Rule source requires an active Pro or Enterprise subscription.
svelte-force-updated-api warning log

You are using an outdated API for svelte. Please upgrade to the newer API.

Rule source requires an active Pro or Enterprise subscription.
svelte-warn-form-action-no-csrf warning log

RISK: SvelteKit form actions without CSRF protection are vulnerable to cross-site request forgery — a malicious site can POST to your action URL from a victim's browser. FIX: SvelteKit's built-in CSRF check validates the Origin header by default, but ensure you have not disabled it via csrf: { checkOrigin: false } in svelte.config.js.

Rule source requires an active Pro or Enterprise subscription.
svelte-warn-private-env-in-component error block

RISK: Importing from '$env/static/private' inside a .svelte component causes SvelteKit to embed the secret value into the client bundle — it will be visible in the browser. FIX: Only use private env vars in +page.server.ts, +layout.server.ts, or +server.ts files. Pass only what the client needs via return {}.

Rule source requires an active Pro or Enterprise subscription.
svelte-warn-server-route-no-auth warning log

RISK: A SvelteKit API route that handles mutations (POST/PUT/PATCH/DELETE) without checking session/user is unauthenticated — any caller can invoke it. FIX: Check locals.user or call auth() at the top of the handler and throw error(401) if unauthenticated.

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
Oct 11, 2026
Hash
cfbedf9609fbe9f0c4499d8cd0b078611e81eded1137e283ebae1b6ef4e23f84
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

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

No commit history available.