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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
32f6098eef
commit
d3c3a928c3
16
.eslintrc
16
.eslintrc
@ -1,18 +1,6 @@
|
|||||||
env:
|
env:
|
||||||
node: true
|
node: true
|
||||||
|
es6: 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
|
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
# Possible Errors
|
# Possible Errors
|
||||||
@ -55,12 +43,10 @@ rules:
|
|||||||
no-trailing-spaces: 2
|
no-trailing-spaces: 2
|
||||||
quotes: [2, "single", "avoid-escape"]
|
quotes: [2, "single", "avoid-escape"]
|
||||||
semi: 2
|
semi: 2
|
||||||
space-after-keywords: 2
|
|
||||||
space-before-blocks: [2, "always"]
|
space-before-blocks: [2, "always"]
|
||||||
space-before-function-paren: [2, "never"]
|
space-before-function-paren: [2, "never"]
|
||||||
space-in-parens: [2, "never"]
|
space-in-parens: [2, "never"]
|
||||||
space-infix-ops: 2
|
space-infix-ops: 2
|
||||||
space-return-throw-case: 2
|
|
||||||
space-unary-ops: 2
|
space-unary-ops: 2
|
||||||
|
|
||||||
# ECMAScript 6
|
# ECMAScript 6
|
||||||
|
@ -24,11 +24,6 @@ module.exports = function(context) {
|
|||||||
|
|
||||||
module.exports.schema = {
|
module.exports.schema = {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': [
|
|
||||||
{
|
|
||||||
'enum': [0, 1, 2]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'additionalItems': {
|
'additionalItems': {
|
||||||
'type': 'string'
|
'type': 'string'
|
||||||
},
|
},
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
|
|
||||||
'at the beginning of this file';
|
|
||||||
|
|
||||||
module.exports = function(context) {
|
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 {
|
return {
|
||||||
'Program:exit': function() {
|
'Program:exit': function() {
|
||||||
context.getScope().through.forEach(function(ref) {
|
const globalScope = context.getScope();
|
||||||
if (ref.identifier.name === 'Buffer') {
|
const variable = globalScope.set.get('Buffer');
|
||||||
context.report(ref.identifier, msg);
|
if (variable) {
|
||||||
}
|
variable.references.forEach(flagIt);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -92,11 +92,6 @@ module.exports = function(context) {
|
|||||||
|
|
||||||
module.exports.schema = {
|
module.exports.schema = {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': [
|
|
||||||
{
|
|
||||||
'enum': [0, 1, 2]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'additionalItems': {
|
'additionalItems': {
|
||||||
'type': 'string'
|
'type': 'string'
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user