Last active
August 29, 2015 14:25
-
-
Save xjamundx/30a2691765c555c30ed1 to your computer and use it in GitHub Desktop.
no-define
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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