WIP: feat: adds `frag` snippet
fixes #735
🚧 This PR is not ready yet
Resolves to React.Fragment shorthand <></>
This PR requires additional improvements:
- You should check the output with nested elements, like
frag>ul>litems*4. Note that the output should be properly formatted - Also check how “Wrap with abbreviation” action works if user wants to wrap existing contents with
fragsnippet (see unit tests for example)
@sergeche Hey! I didn't see a CONTRIBUTING.md guide (I could help create one if needed) so I created this branch and marked it as WIP to show that some work is in progress. Its defineitely not ready yet.
Thanks for the comments! I'll expand the test coverage to cover all possible cases for sure. I'm still in the process of understanding what's going on here in general. For now, I've created a separate test/frag.ts file where all the test cases are located.
I've already added the support for frag and it wraps the passed content(in last commit). The only problem I have now is that it adds unnecessary <></> (I understand why, just searching for a better solution).
Quick question: since <></> is not a valid HTML tag, what should the snippet provide if the jsx.enabled: true option is not set? Should it just return an empty string, or should it work regardless of that option?