Uh oh!
There was an error while loading. Please reload this page.
Add check for reference-compared literals to JS files - #49164
Conversation
typescript-bot
commented
May 18, 2022
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
sandersn
commented
May 24, 2022
Plain JS tests are in A couple of gotchas I thought of:
At least, I think there are shenanigans possible with |
Jack-Works
commented
May 24, 2022
I think there's no need to support the first case. The second case is a bit more interesting, maybe I can add detection to check if the literal contains |
Jack-Works
commented
May 26, 2022
Add test files. |
sandersn
commented
Jun 23, 2022
A couple more examples from @bradzacher's comment: [1,2,3]=='1,2,3'// -> true({toString(){return1}})==1// -> trueThe second one is pretty close to the second example in my comment but arguably more likely to be written as a weird workaround for something. Even a weird workaround shouldn't have an error in JS given the reaction of some JS users when an unavoidable red squiggly shows up. |
Jack-Works
commented
Jun 24, 2022
So we only emit it for |
sandersn
commented
Jun 28, 2022
Yeah, I think so. |
02a9fd2 to
23c0797CompareJack-Works
commented
Jun 29, 2022
done |
Jack-Works
commented
Nov 8, 2022
rebased |
sandersn
left a comment
There was a problem hiding this comment.
Almost ready, just one more change.
It's been a long time, so if you want me to finish this, let me know.
Uh oh!
There was an error while loading. Please reload this page.
cded754 to
f9c029eComparef9c029e to
8925689Compare
I don't know where I can add a test for JS files.
According to discussion in #45978, I open this PR to also check JavaScript files.