-
-
Notifications
You must be signed in to change notification settings - Fork 23
fix: update svelte to 5.0.0-next.181 and fix for {:else if}
#548
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte-eslint-parser": minor | ||
--- | ||
|
||
fix: update svelte to 5.0.0-next.181 and fix for `{:else if}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// FIXME Since the node type is not provided by "svelte/compiler", | ||
// we work around this by extracting the type from the parse function. | ||
// See also https://github.com/sveltejs/svelte/issues/12292 | ||
|
||
import type { parse } from "svelte/compiler"; | ||
|
||
export type Root = ModernParseReturnType<typeof parse>; | ||
export type Fragment = Root["fragment"]; | ||
export type SvelteOptions = Root["options"]; | ||
export type Script = Root["instance"]; | ||
type FragmentChild = Fragment["nodes"][number]; | ||
|
||
export type Text = Extract<FragmentChild, { type: "Text" }>; | ||
|
||
export type ExpressionTag = Extract<FragmentChild, { type: "ExpressionTag" }>; | ||
export type HtmlTag = Extract<FragmentChild, { type: "HtmlTag" }>; | ||
export type ConstTag = Extract<FragmentChild, { type: "ConstTag" }>; | ||
export type DebugTag = Extract<FragmentChild, { type: "DebugTag" }>; | ||
export type RenderTag = Extract<FragmentChild, { type: "RenderTag" }>; | ||
|
||
export type Component = Extract<FragmentChild, { type: "Component" }>; | ||
export type TitleElement = Extract<FragmentChild, { type: "TitleElement" }>; | ||
export type SlotElement = Extract<FragmentChild, { type: "SlotElement" }>; | ||
export type RegularElement = Extract<FragmentChild, { type: "RegularElement" }>; | ||
export type SvelteBody = Extract<FragmentChild, { type: "SvelteBody" }>; | ||
export type SvelteComponent = Extract< | ||
FragmentChild, | ||
{ type: "SvelteComponent" } | ||
>; | ||
export type SvelteDocument = Extract<FragmentChild, { type: "SvelteDocument" }>; | ||
export type SvelteElement = Extract<FragmentChild, { type: "SvelteElement" }>; | ||
export type SvelteFragment = Extract<FragmentChild, { type: "SvelteFragment" }>; | ||
export type SvelteHead = Extract<FragmentChild, { type: "SvelteHead" }>; | ||
export type SvelteOptionsRaw = Extract< | ||
FragmentChild, | ||
{ type: "SvelteOptions" } | ||
>; | ||
export type SvelteSelf = Extract<FragmentChild, { type: "SvelteSelf" }>; | ||
export type SvelteWindow = Extract<FragmentChild, { type: "SvelteWindow" }>; | ||
|
||
export type IfBlock = Extract<FragmentChild, { type: "IfBlock" }>; | ||
export type EachBlock = Extract<FragmentChild, { type: "EachBlock" }>; | ||
export type AwaitBlock = Extract<FragmentChild, { type: "AwaitBlock" }>; | ||
export type KeyBlock = Extract<FragmentChild, { type: "KeyBlock" }>; | ||
export type SnippetBlock = Extract<FragmentChild, { type: "SnippetBlock" }>; | ||
|
||
export type Comment = Extract<FragmentChild, { type: "Comment" }>; | ||
type ComponentAttribute = Component["attributes"][number]; | ||
export type Attribute = Extract<ComponentAttribute, { type: "Attribute" }>; | ||
export type SpreadAttribute = Extract< | ||
ComponentAttribute, | ||
{ type: "SpreadAttribute" } | ||
>; | ||
export type AnimateDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "AnimateDirective" } | ||
>; | ||
export type BindDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "BindDirective" } | ||
>; | ||
export type ClassDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "ClassDirective" } | ||
>; | ||
export type LetDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "LetDirective" } | ||
>; | ||
export type OnDirective = Extract<ComponentAttribute, { type: "OnDirective" }>; | ||
export type StyleDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "StyleDirective" } | ||
>; | ||
export type TransitionDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "TransitionDirective" } | ||
>; | ||
export type UseDirective = Extract< | ||
ComponentAttribute, | ||
{ type: "UseDirective" } | ||
>; | ||
|
||
export type Tag = ExpressionTag | HtmlTag | ConstTag | DebugTag | RenderTag; | ||
export type ElementLike = | ||
| Component | ||
| TitleElement | ||
| SlotElement | ||
| RegularElement | ||
| SvelteBody | ||
| SvelteComponent | ||
| SvelteDocument | ||
| SvelteElement | ||
| SvelteFragment | ||
| SvelteHead | ||
| SvelteOptionsRaw | ||
| SvelteSelf | ||
| SvelteWindow; | ||
export type Block = EachBlock | IfBlock | AwaitBlock | KeyBlock | SnippetBlock; | ||
|
||
export type Directive = | ||
| AnimateDirective | ||
| BindDirective | ||
| ClassDirective | ||
| LetDirective | ||
| OnDirective | ||
| StyleDirective | ||
| TransitionDirective | ||
| UseDirective; | ||
|
||
type ModernParseReturnType<T> = T extends { | ||
(source: string, options: { filename?: string; modern: true }): infer R; | ||
(...args: any[]): any; | ||
} | ||
? R | ||
: any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This workaround is still necessary because we need it to work with svelte v4.