language-tools
language-tools copied to clipboard
🐛 BUG: Shorthand syntax for props is not supported
Describe the Bug
Trying to use the shorthand syntax for props currently lead to an error, ex:
<Component {myProp}/>
We should support this, especially since it's a possible formatting result from the Prettier plugin
Steps to Reproduce
- Create an Astro project
- Create a component with a prop
- Try to pass a prop using shorthand syntax
- Error!
I haven't had a chance to properly test this yet, but I think this regex would do the trick \s{(?'variable'[a-zA-Z_$][a-zA-Z_$0-9]*)}
Here is a reproduction of the issue. It should automatically run astro check
to see the issue.
https://stackblitz.com/edit/github-jcxxvc?file=src%2Fpages%2Findex.astro&on=stackblitz
It seems like the language tools extension is interpreting the values as the props themselves.