-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We are about to upgrade from ESlint 1 to ESLint 2. Remove lint rules that will not exist in ESLint 2. PR-URL: #5214 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: jbergstroem - Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Myles Borins <[email protected]>
- Loading branch information
Showing
4 changed files
with
12 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
}; | ||
}; |
This file contains 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