GitShow/sveltejs/svelte-eslint-parser
sveltejs

svelte-eslint-parser

Svelte parser for ESLint

by sveltejs
eslinteslint-custom-parsereslint-parserparsersveltesveltejs
Star on GitHubForkWebsitenpm

TypeScript

123 stars29 forks17 contributorsActive · 21h agoSince 2021v1.8.0MIT

Meet the team

See all 17 on GitHub →
renovate[bot]Bot
renovate[bot]414 contributions
ota-meshi
ota-meshi362 contributions
github-actions[bot]Bot
github-actions[bot]97 contributions
baseballyama
baseballyama48 contributions
renovate-bot
renovate-bot35 contributions
marekdedic
marekdedic5 contributions
arpitjain099
arpitjain0992 contributions
IWANABETHATGUY
IWANABETHATGUY2 contributions

Languages

View on GitHub →
TypeScript87.1%
Svelte8.5%
JavaScript4.1%
Dockerfile0.2%
HTML0.1%
CSS0%

Commit activity

Last 12 weeks · 44 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
50
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · Last activity 21h ago
See all on GitHub →
marekdedic
`$derived()` in template declaration tags does not inherit type narrowing from enclosing `{#if}` conditionsOpenIssue

Before You File a Bug Report Please Confirm You Have Done The Following... [x] I'm using eslint-plugin-svelte. (.svelte file linting does not work with the parser alone.) [x] I'm sure the problem is a parser problem. (If not sure, open the issue in eslint-plugin-svelte repo instead.) [x] I have tried restarting my IDE and the issue persists. [x] I have updated to the latest version of the packages. What version of ESLint are you using? 10.5.0 What version of eslint-plugin-svelte and svelte-eslint-parser are you using? svelte-eslint-parser@1.8.0 eslint-plugin-svelte@3.20.0 What did you do? Used — the standard Svelte 5 pattern for a reactive template declaration — inside a block whose condition narrows a discriminated union type. Configuration The same declaration without does not error: What did you expect to happen? The expression inside should be type-checked in the same narrowed context as the rest of the branch body. Since the condition narrows to , should be typed as with no ESLint error — the same as when is absent from the declaration. What actually happened? inside is typed as — as if the condition's narrowing was never applied: Isolation testing confirms the bug is specific to : The bug only surfaces in practice with , because that is the tag that requires for reactivity. The legacy tag is inherently non-reactive and does not use , so it is unaffected. Link to GitHub Repo with Minimal Reproducible Example https://github.com/marekdedic/svelte-eslint-parser-derived-repro Additional comments declaration tags were introduced in Svelte 5.56.0, so this is only reachable on very recent Svelte versions. Plain declarations without , and all other runes and function calls tested (, user-defined functions), correctly inherit narrowing. Likely cause: wraps the argument in a function in its generated TypeScript representation, which prevents TypeScript's narrowing (which does not cross function boundaries) from applying. The issue affects any type-aware rule — the root cause is that resolves to type rather than the narrowed . Tested with 5.56.4, 6.0.3, 8.x, Node.js 26.3.1. Disclaimer: issue was investigated and written using LLMs, but verified by a human.

marekdedic · 21h ago

Recent fixes

View closed PRs →
ota-meshi
chore: Update Svelte to 5.56.4 on explorerMergedPR
ota-meshi · 21h ago
Structured data for AI agents

Repository: sveltejs/svelte-eslint-parser. Description: Svelte parser for ESLint Stars: 123, Forks: 29. Primary language: TypeScript. Languages: TypeScript (87.1%), Svelte (8.5%), JavaScript (4.1%), Dockerfile (0.2%), HTML (0.1%). License: MIT. Homepage: https://sveltejs.github.io/svelte-eslint-parser/ Topics: eslint, eslint-custom-parser, eslint-parser, parser, svelte, sveltejs. Latest release: v1.8.0 (3w ago). Open PRs: 19, open issues: 12. Last activity: 21h ago. Community health: 50%. Top contributors: renovate[bot], ota-meshi, github-actions[bot], baseballyama, renovate-bot, marekdedic, arpitjain099, IWANABETHATGUY, 43081j, JounQin and others.

·@ofershap

Replace github.com with gitshow.dev