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>v4.x
committed by
Myles Borins
4 changed files with 12 additions and 33 deletions
@ -1,16 +1,19 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + |
|
||||
'at the beginning of this file'; |
|
||||
|
|
||||
module.exports = function(context) { |
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 { |
return { |
||||
'Program:exit': function() { |
'Program:exit': function() { |
||||
context.getScope().through.forEach(function(ref) { |
const globalScope = context.getScope(); |
||||
if (ref.identifier.name === 'Buffer') { |
const variable = globalScope.set.get('Buffer'); |
||||
context.report(ref.identifier, msg); |
if (variable) { |
||||
} |
variable.references.forEach(flagIt); |
||||
}); |
} |
||||
} |
} |
||||
}; |
}; |
||||
}; |
}; |
||||
|
Loading…
Reference in new issue