detect-disable-mustache-escape.js 504 B

123456789101112131415161718
  1. module.exports = function(context) {
  2. "use strict";
  3. return {
  4. "AssignmentExpression": function(node) {
  5. if (node.operator === '=') {
  6. if (node.left.property) {
  7. if (node.left.property.name == 'escapeMarkup') {
  8. if (node.right.value == false) {
  9. context.report(node, 'Markup escaping disabled.')
  10. }
  11. }
  12. }
  13. }
  14. }
  15. }
  16. }