mozilla / eslint-plugin-no-unsanitized

Custom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
Mozilla Public License 2.0
222 stars 33 forks source link

Unsupported Callee of type YieldExpression for CallExpression #194

Open mjohnst opened 2 years ago

mjohnst commented 2 years ago

Writing react/redux code in Typescript and was experimenting to see if I could call result of yield'd select with some parameters (I do not believe you can actually do this, but I was just seeing if it would work). select from redux-saga/effects version 1.0.5

This triggers the eslint error, though in practice I was passing some parameters:

const test = (yield select())();
mjohnst commented 2 years ago

image

mozfreddyb commented 2 years ago

Yes, that's definitely a bug. Thanks!

mozfreddyb commented 2 years ago

Theoretically, if you had a select function that returns functions and then we'd not be able to scan it. Because you could return whatever function, which is a hard-stop for all sorts of static analysis.

I think we have some existing code that gives up and says "ok, that's bad. stop doing that" which I could reuse. I'm pretty sure the YieldExpression is just an omission here.

@mjohnst: Do I correctly understand that you were just messing around and this is not blocking some sort of important work?

mjohnst commented 2 years ago

@mozfreddyb correct, this is not blocking me at all