rules/no-unsafe-query.js
function validate(node, context) {
  if (!node) {
    return;
  }

  if (node.type === 'TaggedTemplateExpression' && node.tag.name !== 'sql') {
    node = node.quasi;
  }

  if (node.type === 'TemplateLiteral' && node.expressions.length) {
    const literal = node.quasis.map(quasi => quasi.value.raw).join('x');

    if (isSqlQuery(literal)) {
      context.report(node, 'Use the `sql` tagged template literal for raw queries');
    }
  }
}
function validate(node, context) {
  if (!node) {
    return;
  }

  if (node.type === 'TaggedTemplateExpression' && node.tag.name !== 'sql') {
    node = node.quasi;
  }

  if (node.type === 'TemplateLiteral' && node.expressions.length) {
    const literal = node.quasis.map(quasi => quasi.value.raw).join('x');

    if (isSqlQuery(literal)) {
      context.report(node, 'Use the `sql` tagged template literal for raw queries');
    }
  }
}
function validate ( node , context ) { if ( ! node ) { return ; } if ( node . type === 'TaggedTemplateExpression' && node . tag . name !== 'sql' ) { node = node . quasi ; } if ( node . type === 'TemplateLiteral' && node . expressions . length ) { const literal = node . quasis . map ( quasi => quasi . value . raw ) . join ( 'x' ) ; if ( isSqlQuery ( literal ) ) { context . report ( node , 'Use the `sql` tagged template literal for raw queries' ) ; } } }
Validate node.
Validate node .