Skip to content

feat: support comma-separated ignore comments #1235

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

Merged
merged 2 commits into from
May 21, 2025

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented May 20, 2025

This is two things:

  • performance improvements to the algorithm we use for extracting ignore comments
  • support for comma-separated ignore comments

We can now support (as per svelte docs):

<!-- svelte-ignore code1, code2 -->

It also drops multi-line matching in the pattern to avoid matching this kind of funk:

<!-- some
random
multi-line
content
svelte-ignore code1
more content
-->

This is two things:

- performance improvements to the algorithm we use for extracting ignore
	comments
- support for comma-separated ignore comments

We can now support (as per svelte docs):

```html
<!-- svelte-ignore code1, code2 -->
```

It also drops multi-line matching in the pattern to avoid matching this
kind of funk:

```html
<!-- some
random
multi-line
content
svelte-ignore code1
more content
-->
```
Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: b6bd978

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented May 20, 2025

Try the Instant Preview in Online Playground

ESLint Online Playground

Install the Instant Preview to Your Local

npm i https://pkg.pr.new/eslint-plugin-svelte@b6bd978

Published Instant Preview Packages:

View Commit

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!
I have a change request to resolve some old Svelte test failures.

@43081j 43081j force-pushed the ignore-comments-perf branch from 963d28c to 7f0023c Compare May 21, 2025 09:21
@43081j 43081j force-pushed the ignore-comments-perf branch from 7f0023c to b6bd978 Compare May 21, 2025 09:21
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ota-meshi ota-meshi merged commit 6e86e30 into sveltejs:main May 21, 2025
17 checks passed
@43081j 43081j deleted the ignore-comments-perf branch May 21, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants