Svelte

Svelte-specific configuration for Ultracite.

The Svelte configuration has Svelte-specific configuration. This is a minimal preset as Biome doesn't yet have dedicated Svelte-specific linting rules, but it includes important overrides to prevent false positive linting errors in .svelte files.

Installation

Add the Svelte configuration to your biome.jsonc:

biome.jsonc
{
  "extends": ["ultracite/core", "ultracite/svelte"]
}

Overview

This configuration:

  • React-Specific Props: Flags React-specific props like className and htmlFor since Svelte uses standard HTML attributes (class and for)
  • Svelte File Overrides: Relaxed rules for .svelte files to handle Svelte's component structure

Svelte-Specific Rules

Suspicious

RuleSettingDescription
noReactSpecificPropserrorDisallow React-specific props like className and htmlFor in Svelte. Use class and for instead.

Svelte File Overrides

The following rules are disabled for .svelte files to prevent false positives due to Biome's partial support for Svelte components:

Correctness

RuleSettingDescription
noUnusedVariablesoffAllow unused variables in .svelte files. Variables in the script section may only be used in the template.
noUnusedImportsoffAllow unused imports in .svelte files. Imports may only be used in the template section.

Style

RuleSettingDescription
useConstoffAllow let and var declarations in .svelte files for reactive statements.
useImportTypeoffDisable explicit import type requirements for better compatibility with Svelte's build system.

How is this guide?