Skip to content

Instantly share code, notes, and snippets.

@joseph-allen
Created December 20, 2016 09:11
Show Gist options
  • Save joseph-allen/3211b0c25a5c97e7027c91fcd8e26bc2 to your computer and use it in GitHub Desktop.
Save joseph-allen/3211b0c25a5c97e7027c91fcd8e26bc2 to your computer and use it in GitHub Desktop.
/**
* @fileoverview Rule to flag use of _.cloneDeep
* @author Joseph Allen
*/
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
return {
'MemberExpression': function(node) {
if (node.object.name === '_' && node.property.name === 'cloneDeep') {
context.report(node, 'Moonstick won\'t use ' + node.object.name + node.property.name);
}
}
};
};
module.exports.schema = [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment