Skip to content

Instantly share code, notes, and snippets.

@jareware
Created November 21, 2015 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jareware/dccd7053f1304c9aa97c to your computer and use it in GitHub Desktop.
Save jareware/dccd7053f1304c9aa97c to your computer and use it in GitHub Desktop.
module.exports = function(context) {
'use strict';
return {
BinaryExpression: function(node) {
if (node.operator === 'instanceof' && node.left.type === 'UnaryExpression' && node.left.operator === '!') {
context.report(node, "Check dangerous instanceof use (! has higher precedence than instanceof)");
}
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment