Eslint Plugin Svelte screenshot

Eslint Plugin Svelte

Author Avatar Theme by Sveltejs
Updated: 21 May 2025
337 Stars

ESLint plugin for Svelte using AST

Overview:

eslint-plugin-svelte is the official ESLint plugin for Svelte. It provides unique check rules using the template AST. It is designed to be used with ESLint version 7.0.0 and above and requires Node.js version 14.17.x or higher.

Features:

  • Provides many unique check rules using the AST generated by svelte-eslint-parser.
  • Can be configured with .eslintrc.* file to enable specific rules.
  • Provides different configuration options such as base, recommended, prettier, and all.
  • Supports migration from eslint-plugin-svelte v1 or @ota-meshi/eslint-plugin-svelte.
  • Can change the behavior of the plugin using the settings.svelte option.

Installation:

To install eslint-plugin-svelte, follow these steps:

  1. Ensure you have ESLint version 7.0.0 and above installed.
  2. Ensure you have Node.js version 14.17.x or higher installed.
  3. Install the plugin by running the following command:
npm install eslint-plugin-svelte --save-dev
  1. Configure the rules in the .eslintrc.* file. Example .eslintrc.js:
module.exports = {
  plugins: ['svelte'],
  extends: ['plugin:svelte/base'],
  rules: {
    // Add specific rules here
  },
};
  1. Start using eslint-plugin-svelte in your Svelte project.

Summary:

eslint-plugin-svelte is the official ESLint plugin for Svelte that provides unique check rules using the template AST. It requires ESLint version 7.0.0 and above and Node.js version 14.17.x or higher. It offers various configuration options and can be easily installed using npm.