-
-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Svelte 5 is cool with this svelte-ignore comment
// svelte-ignore name_of_warning (whatever text i want)
but this plugin, using the no-unused-svelte-ignore rule treats "(whatever text i want)" as if each word is a name of a rule. It thinks "(whatever" is an unused ignored rule, same for "text", and "i".
Replication
https://svelte.dev/playground/7d1bf802635d4b6aa4e7e19f2e616090?version=5.46.0
<script>
let name = $state('world');
// svelte-ignore state_referenced_locally (this is in parens and should be ignored)
let initial_name = name
</script>
...According to Svelte docs
You can list multiple rules in a single comment (separated by commas), and add an explanatory note (in parentheses) alongside them:
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions (because of reasons) --> <div onclick>...</div>
Actual behavior
And if you run eslint with eslint-plugin-svelte with no-unused-svelte-ignore, then you'll get errors like this:
4:44 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:50 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:53 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:56 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:63 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:67 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
4:74 error svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore
and if I line up the columns with the comment:
// svelte-ignore state_referenced_locally (this is in parens and should be ignored)
// ^ ^ ^ ^ ^ ^ ^
// 44 50 53 56 63 67 74
I don't know why "ignored)" isn't getting an error as well.
Expected
No errors
versions
eslint 9.12.0 (about a year old)
svelte 5.46.0 (latest)
eslint-plugin-svelte 3.13.1 (latest)