Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ESLint
  3. Svelte

Svelte

MITTypeScripteslint-plugin-svelte@3.22.0

Official ESLint plugin for Svelte, providing linting rules and best practices for Svelte components.

Visit WebsiteGitHubGitHub
399 stars70 forks0 contributors

What is Svelte?

eslint-plugin-svelte is the official ESLint plugin for the Svelte framework. It enables developers to enforce code quality, security, and best practices specifically within Svelte components by leveraging the AST generated by svelte-eslint-parser. This tool is essential for maintaining consistent and error-free Svelte codebases.

Target Audience

Svelte developers and teams building applications with Svelte or SvelteKit who need to lint their component code. It is particularly useful for projects requiring adherence to Svelte-specific best practices and security guidelines.

Value Proposition

Developers choose this plugin because it is the authoritative, official linting solution for Svelte, offering over 70 framework-aware rules that cover possible errors, security vulnerabilities, best practices, and stylistic issues. It integrates seamlessly with the modern ESLint ecosystem, supports TypeScript, and provides ready-to-use configurations like 'recommended' and 'prettier'.

Overview

ESLint plugin for Svelte using AST

Use Cases

Best For

  • Enforcing Svelte-specific code quality and best practices in component files.
  • Detecting and preventing security vulnerabilities like XSS attacks from {@html} usage in Svelte templates.
  • Linting SvelteKit projects with rules tailored for page components and navigation.
  • Integrating ESLint with Prettier in Svelte projects using the provided 'prettier' configuration.
  • Automatically fixing stylistic issues in Svelte components with fixable rules via ESLint's --fix option.
  • Maintaining consistent code style and structure across Svelte codebases with rules for indentation, attribute formatting, and mustache spacing.

Not Ideal For

  • Projects still relying on eslint-plugin-svelte3 for legacy Svelte setups or compatibility reasons.
  • Environments with Node.js below v18.18.0 or ESLint below v8.57.1, as these are minimum requirements.
  • Teams seeking a minimalist, zero-config linting solution without Svelte-specific rule customization.

Pros & Cons

Pros

Official Svelte Integration

As the official ESLint plugin maintained by the Svelte team, it seamlessly integrates with the framework's compiler and ecosystem, ensuring authoritative support.

Comprehensive Rule Set

Offers over 70 Svelte-specific rules covering errors, security vulnerabilities like XSS from {@html}, best practices, and stylistic issues, as listed in the README's rule table.

TypeScript and Prettier Support

Fully supports TypeScript with dedicated configuration and provides a 'prettier' config to avoid conflicts, though it requires additional setup for TypeScript projects.

Auto-fix Capabilities

Includes many fixable rules that can automatically correct issues like indentation or attribute formatting using ESLint's --fix option, improving developer workflow.

Cons

Complex TypeScript Setup

The README warns of a TypeScript parser singleton issue that can cause errors if options are changed, complicating configuration for advanced TypeScript projects.

Breaking Changes in Minor Releases

New rules can be added to recommended configs in minor releases per the versioning policy, potentially introducing unexpected warnings that require manual disabling.

Dependency on External Parser

Relies on svelte-eslint-parser for AST generation, adding a layer of dependency that can introduce points of failure or compatibility issues in the linting pipeline.

Frequently Asked Questions

Quick Stats

Stars399
Forks70
Contributors0
Open Issues108
Last commit1 day ago
CreatedSince 2021

Tags

#developer-tools#code-quality#eslint-plugin#sveltejs#eslint#linting#svelte#ast#sveltekit#static-analysis

Links & Resources

Website

Included in

ESLint4.7kSvelte2.1k
Auto-fetched 18 hours ago

Related Projects

React HooksReact Hooks

The library for web and native user interfaces.

Stars246,691
Forks51,164
Last commit18 hours ago
MeteorMeteor

Meteor, the JavaScript App Platform

Stars44,802
Forks5,242
Last commit1 day ago
ReactReact

React-specific linting rules for ESLint

Stars9,289
Forks2,733
Last commit2 months ago
VueJSVueJS

Official ESLint plugin for Vue.js

Stars4,592
Forks715
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub