mirror of https://github.com/lukechilds/node.git
Browse Source
Enables the following rules: - no-undef: Valuable rule to error on usage of undefined variables - require-buffer: Custom rule that forbids usage of the global Buffer inside lib/ because of REPL issues. PR-URL: https://github.com/nodejs/io.js/pull/1794 Reviewed-By: Trevor Norris <trev.norris@gmail.com>v2.3.1-release
7 changed files with 59 additions and 34 deletions
@ -0,0 +1,16 @@ |
|||
'use strict'; |
|||
|
|||
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + |
|||
'at the beginning of this file'; |
|||
|
|||
module.exports = function(context) { |
|||
return { |
|||
'Program:exit': function() { |
|||
context.getScope().through.forEach(function(ref) { |
|||
if (ref.identifier.name === 'Buffer') { |
|||
context.report(ref.identifier, msg); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue