-
-
Notifications
You must be signed in to change notification settings - Fork 16
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: Support runes #425
Merged
Merged
feat: Support runes #425
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e530a0b
wip
baseballyama c9fe482
add expected files for svelte5
baseballyama 82b0679
register globals
baseballyama e5ae173
remove unnecessary files
baseballyama c72d063
add changeset
baseballyama cacef02
format
baseballyama fd8ffa7
update fixture
baseballyama dc6a5f0
add rune tests (wip)
baseballyama fc5ccaa
reduce duplicated expected files
baseballyama ab28e8e
fix test
baseballyama 2bf76a9
revert
baseballyama 8c334b3
update ci
baseballyama 18775dd
fix ci
baseballyama 33031fb
co -> checkout
baseballyama 1d9e7ab
add rune tests
baseballyama 81b5cfa
fix lint
baseballyama 17f11fd
remove duplicated
baseballyama 1affdb3
fix
baseballyama cd492b6
implement json sorter
baseballyama 8cc981c
how about now
baseballyama 90ef27a
remove more duplicated json
baseballyama 2a2f332
more
baseballyama ef863fc
more
baseballyama 658dee1
more
baseballyama f18d155
add more rune ts tests
baseballyama 01dfa17
can i skip?
baseballyama 0a61e91
dry out
baseballyama File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 | ||
--- | ||
|
||
feat: Support runes |
This file contains 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 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,17 @@ | ||
import { VERSION as SVELTE_VERSION } from "svelte/compiler"; | ||
|
||
const globalsForSvelte4: Readonly<string[]> = [ | ||
"$$slots", | ||
"$$props", | ||
"$$restProps", | ||
] as const; | ||
export const globalsForSvelte5 = [ | ||
"$state", | ||
"$derived", | ||
"$effect", | ||
"$effect.pre", | ||
"$props", | ||
] as const; | ||
export const globals = SVELTE_VERSION.startsWith("5") | ||
? [...globalsForSvelte4, ...globalsForSvelte5] | ||
: globalsForSvelte4; |
This file contains 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 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
144 changes: 144 additions & 0 deletions
144
tests/fixtures/parser/ast/$$slots-scope-output-svelte5.json
This file contains 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,144 @@ | ||
{ | ||
"type": "global", | ||
"variables": [ | ||
{ | ||
"name": "$$slots", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [ | ||
{ | ||
"identifier": { | ||
"type": "Identifier", | ||
"name": "$$slots", | ||
"range": [ | ||
5, | ||
12 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
} | ||
}, | ||
"from": "module", | ||
"init": null, | ||
"resolved": null | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "$$props", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$$restProps", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$state", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$derived", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$effect", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$effect.pre", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$props", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
} | ||
], | ||
"references": [], | ||
"childScopes": [ | ||
{ | ||
"type": "module", | ||
"variables": [], | ||
"references": [ | ||
{ | ||
"identifier": { | ||
"type": "Identifier", | ||
"name": "$$slots", | ||
"range": [ | ||
5, | ||
12 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
} | ||
}, | ||
"from": "module", | ||
"init": null, | ||
"resolved": null | ||
} | ||
], | ||
"childScopes": [ | ||
{ | ||
"type": "block", | ||
"variables": [], | ||
"references": [], | ||
"childScopes": [], | ||
"through": [] | ||
} | ||
], | ||
"through": [ | ||
{ | ||
"identifier": { | ||
"type": "Identifier", | ||
"name": "$$slots", | ||
"range": [ | ||
5, | ||
12 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
} | ||
}, | ||
"from": "module", | ||
"init": null, | ||
"resolved": null | ||
} | ||
] | ||
} | ||
], | ||
"through": [] | ||
} |
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.
Since
$effect.pre
is a member of$effect
, I don't think it is necessary to define it here.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.
Fixed!