-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: false positive in quoted-expressions (#209) #210
Conversation
i've had a play around with this and im still unsure what the best way we can do this is basically, we should be able to solve it entirely but just not sure how yet these cases probably fail right now:
since we will be looking for without doing a lookahead, we can't really account for things like so i wonder if the only real fix to this is loosening the check, such that we only check if we're inside a quoted value but don't check for the closing quote anymore |
I scratched my head trying to fix it, I think you need to find a way to go back to HTML tag and then parse its attributes from the beginning if you want to handle all cases Cases like that can be very complicated to handle otherwise
In fact only the 1st one is currently reported as error.
But to be part of attribute value, it must be in quotes due to space, so no need to check it. That's why I ended up by removing closing quote check to handle the 1st case. Side effect of removing closing quote check makes that case not reported anymore as issue |
I checked this test case too {
code: 'html`<x-foo attr=foo${v}></x-foo>`',
options: ['always']
} It's not reported as error (with and without this PR), where it should be :/ |
ok i think i have a solution basically the following behaviour:
|
Your patch is great :) Fixes my issues. |
if you're happy with it, feel free to apply it to this PR (or open another) and ill review again i think it makes sense since we don't need to care about mixed values then (quoted values with multiple expressions/strings) |
…#209) With 43081j patch
bdad361
to
502d6c8
Compare
PR is updated with your patch |
Could you please run a release with last merged PRs ? |
Released in 1.15.0 let me know if all goes well 🙏 |
Awesome, everything works as expected :) |
Proposal to almost fix #209
This is not a perfect solution as there are still some false positive, but much less.
When
${...}
is preceded by=
there will be issue, for exemple there is still issue with: