phadej/jsstana

View on GitHub
eslint-rules/suspicious-throw.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";

var jsstana = require("../lib/jsstana.js");

module.exports = jsstana.eslintRule("(throw (?e nor (new ?exc . ?) (ident ?var) (property)))", function(context, node, m) {
  if (jsstana.match("(string)", m.e)) {
    context.report(node, "Don't throw string");
  }
});