Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Last active August 29, 2015 14:25
Show Gist options
  • Save xjamundx/30a2691765c555c30ed1 to your computer and use it in GitHub Desktop.
Save xjamundx/30a2691765c555c30ed1 to your computer and use it in GitHub Desktop.
no-define
/**
* @fileoverview Rule to prefer require() (CJS) over define() (AMD)
* @author Jamund Ferguson
*/
'use strict';
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
return {
'CallExpression': function(node) {
if (node.callee.name === 'define') {
context.report(node, 'Expected require() instead of define().');
}
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment