-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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 <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>
- 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