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

feat: add rule no-deprecated-raw-special-elements #918

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

mikededo
Copy link
Contributor

@mikededo mikededo commented Nov 15, 2024

Adds a new Svelte 5 specific rule that ensure special elements are used with
svelte: prefix. This rule will help on migrating from Svelte 4, as such
elements were supported without the prefix in Svelte 4.

Adds a new rule that recommends not using raw special elements and fixes to
using the svelte: prefix. Raw special elements are deprecated from v5 on.

Closes #913

Copy link

changeset-bot bot commented Nov 15, 2024

🦋 Changeset detected

Latest commit: b0ee149

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

@mikededo
Copy link
Contributor Author

Hey @ota-meshi, would it be possible to have this rule have different test outputs for each svelte version? As fixes only apply to Svelte 5

@ota-meshi ota-meshi force-pushed the feat/add-no-invalid-html-elements branch from b95c268 to 71abe97 Compare November 27, 2024 07:42
@ota-meshi
Copy link
Member

You can exclude tests for each package version you are testing by placing a _requirements.json in your test fixtures directory and listing the versions your tests require.
However, I don't think you need to do this if your tests pass.

@mikededo
Copy link
Contributor Author

The rule should only be tested in Svelte 5, meaning tests for earlier versions should not produce errors related to Svelte 5 behavior.

@mikededo mikededo force-pushed the feat/add-no-invalid-html-elements branch from 851cbef to 0ef42f3 Compare November 27, 2024 10:47
@mikededo mikededo force-pushed the feat/add-no-invalid-html-elements branch from a624263 to bc20978 Compare November 27, 2024 11:02
@mikededo mikededo force-pushed the feat/add-no-invalid-html-elements branch from a77b03e to 1be1e99 Compare November 27, 2024 11:08
@ota-meshi ota-meshi changed the title feat: add rule no-invalid-html-elements feat: add rule no-deprecated-raw-special-elements Nov 27, 2024
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.

LGTM! Thank you!

@ota-meshi ota-meshi merged commit 5da98c9 into sveltejs:main Nov 27, 2024
20 checks passed
ota-meshi pushed a commit that referenced this pull request Nov 28, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## eslint-plugin-svelte@3.0.0-next.1

### Minor Changes

- [#918](#918)
[`5da98c9`](5da98c9)
Thanks [@mikededo](https://github.com/mikededo)! - Added new
`no-deprecated-raw-special-elements` rule

- [#836](#836)
[`3fa90aa`](3fa90aa)
Thanks [@renovate](https://github.com/apps/renovate)! - feat: support
for typescript-eslint v8 to `svelte/indent` rule

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

Detect invalid HTML elements
2 participants