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

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

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 } };
Debug
Known footguns
deprecatedThis plugin is deprecated. Svelte 4+ users should use eslint-plugin-svelte with svelte-eslint-parser.
breakingVersion 4.0.0 requires ESLint 8+. ESLint 6/7 are no longer supported.
gotchaProcessor must be 'svelte3/svelte3', not 'svelte3'. The default export is not a processor.
gotchaTypeScript mode requires passing the typescript package to settings.svelte3/typescript. Without it, template expressions are not linted.
deprecatedSetting 'svelte3/ignore-styles' returns a function now; in v3 it was a boolean. Booleans may cause unexpected behavior.
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.

Agent activity
14 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
bingbot
1
Resources