An ESLint plugin for linting Svelte v3 components. Version 4.0.0 transforms Svelte compiler errors/warnings into ESLint messages, lints script blocks and template expressions with existing rules, and respects Svelte scoping (stores, reactive declarations). Requires ESLint 8+ and Svelte 3.2+. Differentiates from svelte-eslint-parser by being processor-based and using the Svelte compiler directly; deprecated in favor of eslint-plugin-svelte for Svelte 4+.
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Must be 'svelte3/svelte3' not just 'svelte3'
module.exports = { plugins: ['svelte3'], overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }] }
Function form enables dynamic require; boolean true loads peer dependency
settings: { 'svelte3/typescript': () => require('typescript') }
Use @typescript-eslint/parser (v2+) not the deprecated typescript-eslint-parser
parser: '@typescript-eslint/parser', plugins: ['svelte3','@typescript-eslint']
Basic ESLint config for Svelte v3 using eslint-plugin-svelte3 processor, ignoring CSS styles.
// .eslintrc.js
module.exports = {
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
es6: true,
browser: true
},
plugins: ['svelte3'],
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3'
}
],
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^\\$' }]
},
settings: {
'svelte3/ignore-styles': () => true // ignore CSS linting
}
};
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.