Support extracting tags from Svelte files#94
Merged
AlexMost merged 4 commits intottag-org:masterfrom Mar 24, 2020
Merged
Conversation
Contributor
Author
Member
|
Thanks, that looks awesome! Unfortunately, still, I have no experience with Svelte, it would be great if you could provide some example or doc how we can use ttag and svelte! Anyway, thanks for the great job, will try to fix ts errors and release ASAP. |
eavae
pushed a commit
to eavae/ttag-cli
that referenced
this pull request
Mar 25, 2020
* Add @types/walk to make unit test happy * Svelte file support * Add svelte AST interfaces to make tsc happy * Remove redundant test.only
Draft
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Inspired by Vue integration, I added tag extraction support for
sveltefiles in this PR, which is the component file used in Svelte.In order to support extraction of
tin template, I includedsvelteas dependency in order to leverage it's exposed built-in parser. However, it seems that the type definition insveltelacks some dependency, which will trigger Typescript errors. I am new to Typescript and not very sure how we should handle this.Also,
estree-walkeris included to walk through the AST -- which can be replaced by any other ESTree traversal tool.Please let me know if there is any concern regarding this PR. Thanks!