Skip to content

Commit 789f621

Browse files
TrottMyles Borins
authored and
Myles Borins
committedMar 1, 2016
tools: remove obsolete lint rules
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>
1 parent be9e761 commit 789f621

File tree

4 files changed

+12
-33
lines changed

4 files changed

+12
-33
lines changed
 

‎.eslintrc

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
env:
22
node: true
3-
4-
# enable ECMAScript features
5-
ecmaFeatures:
6-
arrowFunctions: true
7-
binaryLiterals: true
8-
blockBindings: true
9-
classes: true
10-
forOf: true
11-
generators: true
12-
objectLiteralShorthandMethods: true
13-
objectLiteralShorthandProperties: true
14-
octalLiterals: true
15-
templateStrings: true
3+
es6: true
164

175
rules:
186
# Possible Errors
@@ -55,12 +43,10 @@ rules:
5543
no-trailing-spaces: 2
5644
quotes: [2, "single", "avoid-escape"]
5745
semi: 2
58-
space-after-keywords: 2
5946
space-before-blocks: [2, "always"]
6047
space-before-function-paren: [2, "never"]
6148
space-in-parens: [2, "never"]
6249
space-infix-ops: 2
63-
space-return-throw-case: 2
6450
space-unary-ops: 2
6551

6652
# ECMAScript 6

‎tools/eslint-rules/new-with-error.js

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ module.exports = function(context) {
2424

2525
module.exports.schema = {
2626
'type': 'array',
27-
'items': [
28-
{
29-
'enum': [0, 1, 2]
30-
}
31-
],
3227
'additionalItems': {
3328
'type': 'string'
3429
},

‎tools/eslint-rules/require-buffer.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
'use strict';
22

3-
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
4-
'at the beginning of this file';
5-
63
module.exports = function(context) {
4+
function flagIt(reference) {
5+
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
6+
'at the beginning of this file';
7+
context.report(reference.identifier, msg);
8+
}
9+
710
return {
811
'Program:exit': function() {
9-
context.getScope().through.forEach(function(ref) {
10-
if (ref.identifier.name === 'Buffer') {
11-
context.report(ref.identifier, msg);
12-
}
13-
});
12+
const globalScope = context.getScope();
13+
const variable = globalScope.set.get('Buffer');
14+
if (variable) {
15+
variable.references.forEach(flagIt);
16+
}
1417
}
1518
};
1619
};

‎tools/eslint-rules/required-modules.js

-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ module.exports = function(context) {
9292

9393
module.exports.schema = {
9494
'type': 'array',
95-
'items': [
96-
{
97-
'enum': [0, 1, 2]
98-
}
99-
],
10095
'additionalItems': {
10196
'type': 'string'
10297
},

0 commit comments

Comments
 (0)
Please sign in to comment.