mirror of https://github.com/lukechilds/node.git
Browse Source
We are about to upgrade from ESlint 1 to ESLint 2. Remove lint rules that will not exist in ESLint 2. PR-URL: https://github.com/nodejs/node/pull/5214 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Myles Borins <myles.borins@gmail.com>process-exit-stdio-flushing
Rich Trott
9 years ago
4 changed files with 12 additions and 33 deletions
@ -1,16 +1,19 @@ |
|||
'use strict'; |
|||
|
|||
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + |
|||
'at the beginning of this file'; |
|||
|
|||
module.exports = function(context) { |
|||
function flagIt(reference) { |
|||
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + |
|||
'at the beginning of this file'; |
|||
context.report(reference.identifier, msg); |
|||
} |
|||
|
|||
return { |
|||
'Program:exit': function() { |
|||
context.getScope().through.forEach(function(ref) { |
|||
if (ref.identifier.name === 'Buffer') { |
|||
context.report(ref.identifier, msg); |
|||
} |
|||
}); |
|||
const globalScope = context.getScope(); |
|||
const variable = globalScope.set.get('Buffer'); |
|||
if (variable) { |
|||
variable.references.forEach(flagIt); |
|||
} |
|||
} |
|||
}; |
|||
}; |
|||
|
Loading…
Reference in new issue