Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
9.28.0
What version of eslint-plugin-svelte
are you using?
3.9.1
What did you do?
Configuration
import js from "@eslint/js";
import sveltePlugin from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
import tseslint from "typescript-eslint";
import svelteConfig from './svelte.config.js';
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
...sveltePlugin.configs["flat/recommended"],
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: {
ts: "@typescript-eslint/parser",
},
extraFileExtensions: [".svelte"],
svelteConfig,
},
},
rules: {
'svelte/valid-compile': [
'error',
{
ignoreWarnings: false
}
],
},
},
);
After forcing runes mode with runes: true
in svelte.config.js, vite catchs new warnings but ESLint with svelte/valid-compile
rule doesn't catch new warnings.
From there https://github.com/uh-zuh/eslint-plugin-svelte_bug_reproduction_valid-compile
I run:
npm run build
and see 2 errors:
npm run build
> build
> vite build --config vite.config.ts
vite v6.3.5 building for production...
transforming (6) node_modules/svelte/src/internal/shared/utils.js10:14:26 PM [vite-plugin-svelte] src/Test1.svelte:3:8 `count` is updated, but is not declared
with `$state(...)`. Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update
1: <script lang="ts">
2:
3: let count = 0;
^
4: function increment() {
5: count += 1;
10:14:27 PM [vite-plugin-svelte] src/Test2.svelte:3:8 `count` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update
1: <script lang="ts">
2: let { param } = $props();
3: let count = 0;
^
4: function increment() {
5: count += 1;
✓ 96 modules transformed.
dist/index.html 0.33 kB │ gzip: 0.23 kB
dist/assets/index-QBnuIdet.js 11.51 kB │ gzip: 5.06 kB
✓ built in 2.38s
but when I run
npm run eslint
I get only 1 error:
npm run eslint
> eslint
> eslint --config eslint.config.js .
/app_full/_test/src/Test2.svelte
3:9 error `count` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update(non_reactive_update) svelte/valid-compile
✖ 1 problem (1 error, 0 warnings)
What did you expect to happen?
2 errors: In files Test1.svelte and Test2.svelte
What actually happened?
1 error: Only in file Test2.svelte
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/uh-zuh/eslint-plugin-svelte_bug_reproduction_valid-compile
Run following commands and compare results:
npm run build
rpm run eslint
Additional comments
This approach doesn't help too: https://github.com/sveltejs/svelte-eslint-parser?tab=readme-ov-file#parseroptionssveltefeatures
Metadata
Metadata
Assignees
Labels
No labels