Skip to content

Commit

Permalink
tools: remove obsolete lint rules
Browse files Browse the repository at this point in the history
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
Trott authored and rvagg committed Feb 21, 2016
1 parent 8d6e679 commit 13af565
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 33 deletions.
16 changes: 1 addition & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
env:
node: true

# enable ECMAScript features
ecmaFeatures:
arrowFunctions: true
binaryLiterals: true
blockBindings: true
classes: true
forOf: true
generators: true
objectLiteralShorthandMethods: true
objectLiteralShorthandProperties: true
octalLiterals: true
templateStrings: true
es6: true

rules:
# Possible Errors
Expand Down Expand Up @@ -55,12 +43,10 @@ rules:
no-trailing-spaces: 2
quotes: [2, "single", "avoid-escape"]
semi: 2
space-after-keywords: 2
space-before-blocks: [2, "always"]
space-before-function-paren: [2, "never"]
space-in-parens: [2, "never"]
space-infix-ops: 2
space-return-throw-case: 2
space-unary-ops: 2

# ECMAScript 6
Expand Down
5 changes: 0 additions & 5 deletions tools/eslint-rules/new-with-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ module.exports = function(context) {

module.exports.schema = {
'type': 'array',
'items': [
{
'enum': [0, 1, 2]
}
],
'additionalItems': {
'type': 'string'
},
Expand Down
19 changes: 11 additions & 8 deletions tools/eslint-rules/require-buffer.js
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);
}
}
};
};
5 changes: 0 additions & 5 deletions tools/eslint-rules/required-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ module.exports = function(context) {

module.exports.schema = {
'type': 'array',
'items': [
{
'enum': [0, 1, 2]
}
],
'additionalItems': {
'type': 'string'
},
Expand Down

0 comments on commit 13af565

Please sign in to comment.