-
-
Notifications
You must be signed in to change notification settings - Fork 23
feat: support {@attach ...}
#714
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
Conversation
🦋 Changeset detectedLatest commit: 74351f7 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 |
Pull Request Test Coverage Report for Build 15033208451Details
💛 - Coveralls |
Try the Instant Preview in Online PlaygroundInstall the Instant Preview to Your Local
Published Instant Preview Packages:
|
@ota-meshi This is my first time adding support for a new Node in the parser, so could you check if I missed anything? |
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.
Awesome!!! Looks almost good!
I have made two comments so could you please make some easy fixes?
Also could you please add some documentation explaining that the new node indicates {@attach}
?
https://github.com/sveltejs/svelte-eslint-parser/blob/main/docs/AST.md#directives
src/parser/svelte-ast-types.ts
Outdated
@@ -203,6 +203,12 @@ export interface AttributeShorthand extends BaseNode { | |||
type: "AttributeShorthand"; | |||
expression: ESTree.Identifier; | |||
} | |||
|
|||
export interface AttachTag extends BaseNode { |
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 file is an AST type for Svelte v4, so there is no need to add 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.
Oh I see!
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "@", |
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.
The @attach
token is not valid. Please refer to the implementation of @const
and @html
😉
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.
Ohh I missed this point!
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.
Looks perfect! Thank you!
see: sveltejs/svelte#15000