module.exports = function()

in textlint/rules/terminology.js [4:26]


module.exports = function(context) {
  const {Syntax} = context;
  return {
    [Syntax.Str](node) {
      const {getSource, RuleError, report} = context;
      const text = getSource(node);

      for (const term of terms) {
        for (const expression of term.expressions) {
          let result;
          while ((result = expression.exec(text))) {
            report(
              node,
              new RuleError(term.message, {
                index: result.index,
              }),
            );
          }
        }
      }
    },
  };
};