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

fix: false positives for custom-element with svelte v3 in svelte/valid-compile #604

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

ota-meshi
Copy link
Member

fixes #602

Copy link

changeset-bot bot commented Nov 3, 2023

🦋 Changeset detected

Latest commit: 60a56e4

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 Patch

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

warnings: Warning[];
kind: 'warn' | 'error';
} {
try {
const result = compiler.compile(code, {
generate: false,
...(semver.satisfies(compiler.VERSION, '>=4.0.0-0') ? { customElement: true } : {})
...(semver.satisfies(compiler.VERSION, '>=4.0.0-0')
? { customElement: true }
Copy link
Member

Choose a reason for hiding this comment

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

[ask]

Why always we can set { customElement: true } if Svelte version is 4?

Copy link
Member Author

Choose a reason for hiding this comment

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

In v3, if customElement:true is set, a warning will be returned if <svelte:options tag> is missing, but in v4, there will be no warning even if <svelte:options customElement> is missing.

@baseballyama baseballyama merged commit 796c0ad into main Nov 3, 2023
@baseballyama baseballyama deleted the svelte3-custom-element branch November 3, 2023 02:36
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.

False Positive for 'customElement: true'.
2 participants