mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 14:54:35 +00:00

Apply our eslint rules to the code for our custom eslint rules. Eslint Inception! Maybe. I never saw that movie... PR-URL: https://github.com/nodejs/node/pull/3195 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Roman Reiss <me@silverwind.io>
17 lines
392 B
JavaScript
17 lines
392 B
JavaScript
'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);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
};
|