Svelte parser for ESLint
npm install svelte-eslint-parser








The svelte-eslint-parser aims to make it easy to create your own ESLint rules for Svelte.
eslint-plugin-svelte is an ESLint plugin built upon this parser, and it already implements some rules.
#### eslint-plugin-svelte
ESLint plugin for Svelte.
Provides a variety of template-based checks using the Svelte AST.
#### @intlify/eslint-plugin-svelte
ESLint plugin for internationalization (i18n) in Svelte applications, offering helpful i18n-related rules.
---
``bash`
npm install --save-dev eslint svelte-eslint-parser
---
`js
import js from "@eslint/js";
import svelteParser from "svelte-eslint-parser";
export default [
js.configs.recommended,
{
files: [
"*/.svelte",
"*.svelte",
// Need to specify the file extension for Svelte 5 with rune symbols
"*/.svelte.js",
"*.svelte.js",
"*/.svelte.ts",
"*.svelte.ts",
],
languageOptions: {
parser: svelteParser,
},
},
];
`
`bash`
eslint "src/*/.{js,svelte}"
---
The parserOptions for this parser generally match what espree—ESLint's default parser—supports.
For example:
`js
import svelteParser from "svelte-eslint-parser";
export default [
// ...
{
files: [
// Set .svelte/.js/.ts files. See above for more details.
],
languageOptions: {
parser: svelteParser,
parserOptions: {
sourceType: "module",
ecmaVersion: 2024,
ecmaFeatures: {
globalReturn: false,
impliedStrict: false,
jsx: false,
},
},
},
},
];
`
Use the parserOptions.parser property to define a custom parser for