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

Feature Idea: adding another rule for HTML parsing #233

Open mozfreddyb opened 7 months ago

mozfreddyb commented 7 months ago

This is a nice feature idea for a rainy day. The linter focuses on methods/property access that does parsing + insertion (e.g., document.write(), innerHTML=) as these are immediately dangerous.

I think there's value in providing another rule that controls and parsing only. So far, I have stayed away from it as grouping it into the method or property rule would add errors for coding behavior that is not immediately risky.

The solution is, of course, to add another rule that users are encouraged to set to warning rather than error.