mozilla / eslint-plugin-no-unsanitized

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

Do we need to scan ternary or logical expressions? #62

Open mozfreddyb opened 7 years ago

mozfreddyb commented 7 years ago

Examples:

let endTime = (mapEnd || (e => e.delta))(this._data[this._data.length - 1]);

and

(text.endsWith("\n") ? document.write : document.writeln)(text)

Would be interesting if we could deep-dive into left/right attributes of the LogicalExpression (or the consequent/alternate attributes of the ConditionalExpression respectively)