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

Ensure Unsupported Expressions are always throwing #159

Closed mozfreddyb closed 2 years ago

mozfreddyb commented 3 years ago

We have loud, annoying errors for unexpected and unsupported expressions. This helps us keep up-to-date with upcoming and bleeding edge JavaScript features and is a nice forcing function to make sure we're doing so well. (as an aside: Historically, the incentive for most reporters is unfortunately to "make the error go away" rather than scanning the new expression thoroughly and well, but that just means we need to apply more scrutiny to those cases and make sure there are great tests for these features).

What I noticed though, is that we don't have a test to ensure that a WontEverExistfantasyExpression will always throw an error. We should do that and I think it could be an easy bug for an outside contributor.

mozfreddyb commented 2 years ago

170