-
-
Notifications
You must be signed in to change notification settings - Fork 39
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 config option for foreign elements in svelte/html-self-closing
rule
#841
Conversation
🦋 Changeset detectedLatest commit: 41a8af0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -0,0 +1,140 @@ | |||
export const voidElements = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from removed void-elemets.ts
file. It's actually different that the list that Svelte uses (https://github.com/sveltejs/svelte/blob/c32a91891fc647998f738371a012fcba97d56e50/packages/svelte/src/utils.js#L16-L33).
'wbr' | ||
]; | ||
|
||
export const svgElements = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'vkern' | ||
]; | ||
|
||
export const mathmlElements = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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! LGTM!
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. # Releases ## [email protected] ### Minor Changes - [#841](#841) [`85053a1`](85053a1) Thanks [@jrmajor](https://github.com/jrmajor)! - feat: add config option for foreign elements in `svelte/html-self-closing` rule ### Patch Changes - [#853](#853) [`690c04e`](690c04e) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: update svelte-eslint-parser to 0.41.1 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR adds separate configuration option for foreign (SVG and MathML) elements to
svelte/html-self-closing
rule.According to HTML spec (https://html.spec.whatwg.org/multipage/syntax.html#elements-2):
This means that
<div/>
is invalid, while<path/>
(which is a SVG element) is OK. This configuration option would allow users to take advantage of the terser SVG syntax, while still using correct HTML syntax for normal elements (likediv
).Closes #837.