Registry / testing / eslint-plugin-svelte3

eslint-plugin-svelte3

JSON →
library4.0.0jsnpmunverified

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+.

npm install eslint-plugin-svelte3
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-SVEL
E
eslint-plugin-svelte3
testingjavascriptv4.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

processor
module.exports = { plugins: ['svelte3'], overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }] }
processor: 'svelte3'
Must be 'svelte3/svelte3' not just 'svelte3'
settings.svelte3/typescript
settings: { 'svelte3/typescript': () => require('typescript') }
settings: { svelte3: { typescript: true } }
Function form enables dynamic require; boolean true loads peer dependency
config with TypeScript parser
parser: '@typescript-eslint/parser', plugins: ['svelte3','@typescript-eslint']
parser: 'typescript-eslint-parser'
Use @typescript-eslint/parser (v2+) not the deprecated typescript-eslint-parser

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 } };
Debug
Known issues
deprecatedThis plugin is deprecated. Svelte 4+ users should use eslint-plugin-svelte with svelte-eslint-parser.
fix
Migrate to eslint-plugin-svelte (https://github.com/sveltejs/eslint-plugin-svelte)
affects: >=4.0.0
breakingVersion 4.0.0 requires ESLint 8+. ESLint 6/7 are no longer supported.
fix
Upgrade to ESLint 8+ or stick with v3 (deprecated) if using older ESLint.
affects: >=4.0.0
gotchaProcessor must be 'svelte3/svelte3', not 'svelte3'. The default export is not a processor.
fix
Set processor to 'svelte3/svelte3' in overrides.
affects: >=1.0.0
gotchaTypeScript mode requires passing the typescript package to settings.svelte3/typescript. Without it, template expressions are not linted.
fix
Add 'svelte3/typescript': () => require('typescript') to settings.
affects: >=3.0.0
deprecatedSetting 'svelte3/ignore-styles' returns a function now; in v3 it was a boolean. Booleans may cause unexpected behavior.
fix
Use a function: 'svelte3/ignore-styles': () => true
affects: >=4.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-svelte3".
Plugin not installed or not in node_modules.
fix
Run: npm install --save-dev eslint-plugin-svelte3
Definition for rule 'no-unused-vars' was not found.
eslint-plugin-svelte3 does not define rules; it only provides a processor. The rule comes from eslint core.
fix
Ensure eslint is properly installed and your config includes 'eslint:recommended' or the rule explicitly.
Failed to load parser '@typescript-eslint/parser'.
Missing @typescript-eslint/parser package when using TypeScript.
fix
Install: npm install --save-dev @typescript-eslint/parser
The 'svelte3/svelte3' processor is not exported from the plugin.
Using an older version (<1.0.0) that didn't export the processor this way.
fix
Upgrade to >=1.0.0: npm install eslint-plugin-svelte3@latest
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency - plugin requires ESLint 8+ to function
svelterequiredPeer dependency - uses svelte/compiler internally
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-svelte3 — npm install eslint-plugin-svelte3 · libregistry