Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte5: Add svelte/no-legacy-svelte-ignore rule #773

Open
ota-meshi opened this issue Jun 9, 2024 · 0 comments
Open

Svelte5: Add svelte/no-legacy-svelte-ignore rule #773

ota-meshi opened this issue Jun 9, 2024 · 0 comments
Labels

Comments

@ota-meshi
Copy link
Member

Motivation

Svelte v5 changed the format of error codes to snake_case, but svelte-ignore still works for the previous kebab-case error codes.
However, I expect support for the old format will be removed eventually.
The new rule help with this migration.

Description

The new rule disallow svelte-ignore using old-style error codes.
Note, however, that they will only be reported if you are using Svelte v5 or later.

Examples

<!-- ✓ GOOD -->
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
<span tabindex="0">
	<span class="element"></span>
</span>
<div>
	<!-- svelte-ignore block_empty -->
	{#await Promise.resolve(foo)}
	{/await}
</div>

<!-- ✗ BAD -->
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<span tabindex="0">
	<span class="element"></span>
</span>
<div>
	<!-- svelte-ignore empty-block -->
	{#await Promise.resolve(foo)}
	{/await}
</div>

Additional comments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant