eslint
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -365,2 +365,3 @@ { | ||
"no-path-concat": 2, | ||
"handle-callback-err": [2, "err"], | ||
"no-process-exit": 2 | ||
@@ -367,0 +368,0 @@ } |
@@ -103,2 +103,3 @@ { | ||
"max-statements": [0, 10], | ||
"handle-callback-err": 0, | ||
"new-cap": 2, | ||
@@ -105,0 +106,0 @@ "new-parens": 2, |
@@ -128,4 +128,6 @@ /** | ||
this.exclusionsCache = {}; | ||
this.baseConfig = require(path.resolve(__dirname, "..", "conf", "eslint.json")); | ||
this.baseConfig = options.reset ? { rules: {} } : | ||
require(path.resolve(__dirname, "..", "conf", "eslint.json")); | ||
this.baseConfig.format = options.format; | ||
this.useEslintrc = (options.eslintrc !== false); | ||
useConfig = options.config; | ||
@@ -158,4 +160,6 @@ | ||
userConfig = this.useSpecificConfig; | ||
} else if (this.useEslintrc) { | ||
userConfig = getLocalConfig(this, directory); | ||
} else { | ||
userConfig = getLocalConfig(this, directory); | ||
userConfig = {}; | ||
} | ||
@@ -162,0 +166,0 @@ |
@@ -47,3 +47,12 @@ /** | ||
description: "Outputs the version number." | ||
}, { | ||
option: "reset", | ||
type: "Boolean", | ||
description: "Set all default rules to off." | ||
}, { | ||
option: "eslintrc", | ||
type: "Boolean", | ||
default: "true", // Optionator only accepts string defaults | ||
description: "Enable loading .eslintrc configuration." | ||
}] | ||
}); |
@@ -69,3 +69,4 @@ /** | ||
pushScope(); | ||
declare(node.params.concat(node.id).map(function(id) { return id.name; })); | ||
declare(node.params.map(function(id) { return id.name; })); | ||
declare(node.id ? [node.id.name] : []); | ||
} | ||
@@ -72,0 +73,0 @@ |
@@ -16,3 +16,4 @@ /** | ||
var OPEN_MESSAGE = "Opening curly brace does not appear on the same line as controlling statement.", | ||
CLOSE_MESSAGE = "Closing curly brace does not appear on the same line as the subsequent block."; | ||
CLOSE_MESSAGE = "Closing curly brace does not appear on the same line as the subsequent block.", | ||
CLOSE_MESSAGE_STROUSTRUP = "Closing curly brace appears on the same line as the subsequent block."; | ||
@@ -64,3 +65,3 @@ //-------------------------------------------------------------------------- | ||
if (tokens[0].loc.start.line === tokens[1].loc.start.line) { | ||
context.report(node.alternate, CLOSE_MESSAGE); | ||
context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP); | ||
} | ||
@@ -89,3 +90,3 @@ } | ||
if (tokens[0].loc.start.line === tokens[1].loc.start.line) { | ||
context.report(node.finalizer, CLOSE_MESSAGE); | ||
context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP); | ||
} | ||
@@ -114,3 +115,3 @@ } | ||
if (tokens[0].loc.start.line === tokens[1].loc.start.line) { | ||
context.report(node, CLOSE_MESSAGE); | ||
context.report(node, CLOSE_MESSAGE_STROUSTRUP); | ||
} | ||
@@ -117,0 +118,0 @@ } |
@@ -21,5 +21,11 @@ /** | ||
function bothAreSameTypeLiterals(node) { | ||
return node.left.type === "Literal" && node.right.type === "Literal" && typeof node.left.value === typeof node.right.value; | ||
return node.left.type === "Literal" && node.right.type === "Literal" && | ||
typeof node.left.value === typeof node.right.value; | ||
} | ||
function isNullCheck(node) { | ||
return (node.right.type === "Literal" && node.right.value === null) || | ||
(node.left.type === "Literal" && node.left.value === null); | ||
} | ||
return { | ||
@@ -29,3 +35,4 @@ "BinaryExpression": function(node) { | ||
if (context.options[0] === "smart" && (isTypeOf(node) || bothAreSameTypeLiterals(node))) { | ||
if (context.options[0] === "smart" && (isTypeOf(node) || | ||
bothAreSameTypeLiterals(node)) || isNullCheck(node)) { | ||
return; | ||
@@ -41,2 +48,2 @@ } | ||
}; | ||
}; | ||
}; |
@@ -27,3 +27,3 @@ /** | ||
if(secondToLastToken.value === "," && items.length && lastItem) { | ||
context.report(lastItem, "Trailing comma."); | ||
context.report(lastItem, secondToLastToken.loc.start, "Trailing comma."); | ||
} | ||
@@ -30,0 +30,0 @@ } |
@@ -5,4 +5,4 @@ /** | ||
*/ | ||
"use strict"; | ||
//------------------------------------------------------------------------------ | ||
@@ -13,4 +13,2 @@ // Rule Definition | ||
"use strict"; | ||
var always = context.options[0] !== "never"; | ||
@@ -34,3 +32,3 @@ | ||
if (token.type !== "Punctuator" || token.value !== ";") { | ||
context.report(node, node.loc.end, "Missing semicolon."); | ||
context.report(node, token.loc.end, "Missing semicolon."); | ||
} | ||
@@ -37,0 +35,0 @@ } else { |
{ | ||
"name": "eslint", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>", | ||
@@ -18,2 +18,3 @@ "description": "An Esprima-based pattern checker for JavaScript.", | ||
"browserify": "node Makefile.js browserify", | ||
"perf": "node Makefile.js perf", | ||
"profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js" | ||
@@ -35,4 +36,4 @@ }, | ||
"estraverse": "~1.3.0", | ||
"esprima": "*", | ||
"escope": "1.0.0", | ||
"esprima": "~1.1.1", | ||
"escope": "~1.0.0", | ||
"glob": "~3.2.7", | ||
@@ -39,0 +40,0 @@ "text-table": "~0.2.0", |
Floating dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
255560
133
6529
0
+ Addedescope@1.0.3(transitive)
+ Addedesprima@1.1.1(transitive)
+ Addedestraverse@2.0.0(transitive)
- Removedescope@1.0.0(transitive)
- Removedesprima@4.0.1(transitive)
Updatedescope@~1.0.0
Updatedesprima@~1.1.1