diff --git a/.eslintrc b/.eslintrc index e3e78971b..9458140f8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,7 @@ { "env": { - "node": true + "node": true, + "mocha": true }, "rules": { "brace-style": [2, "1tbs", { "allowSingleLine": true }], @@ -15,6 +16,7 @@ "no-use-before-define": 2, "radix": 2, "semi": 2, + "block-spacing": 2, "space-infix-ops": 2, "strict": 0 }, diff --git a/bin/eslint.js b/bin/eslint.js index cc90d110f..4cbda78b1 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -44,6 +44,8 @@ function buildIssueJson(message, path) { if(message.fatal) { checkName = "fatal"; } + var line = message.line || 1; + var column = message.column || 1; var issue = { type: "issue", @@ -57,12 +59,12 @@ function buildIssueJson(message, path) { path: path, positions: { begin: { - line: message.line || 1, - column: message.column || 1 + line: line, + column: column }, end: { - line: message.line || 1, - column: message.column || 1 + line: line, + column: column } } }, @@ -166,6 +168,10 @@ runWithTiming("engineConfig", function () { options.extensions = userConfig.extensions; } + if (userConfig.ignore_path) { + options.ignorePath = userConfig.ignore_path; + } + if (userConfig.debug) { debug = true; } diff --git a/test/checks_test.js b/test/checks_test.js index ed086a240..e51f959ae 100644 --- a/test/checks_test.js +++ b/test/checks_test.js @@ -13,6 +13,9 @@ describe("checks module", function() { }); describe(".remediationPoints()", function() { + var eslintConfig = function(rulesConfig) { + return { rules: rulesConfig }; + }; it("returns the default of 50,000 for a non-complexity issue", function() { var issue = { ruleId: "eqeqeq", message: "always use ==="}; expect(checks.remediationPoints(issue.ruleId, issue, null)).to.eq(50000); @@ -41,9 +44,5 @@ describe("checks module", function() { , config = eslintConfig({ "complexity": [2, 10] }); expect(checks.remediationPoints(issue.ruleId, issue, config)).to.eq(1000000); }); - - var eslintConfig = function(rulesConfig) { - return { rules: rulesConfig }; - }; }); }); diff --git a/test/validate_config_test.js b/test/validate_config_test.js index 1d7b5bc8f..6c1fa065f 100644 --- a/test/validate_config_test.js +++ b/test/validate_config_test.js @@ -13,7 +13,7 @@ describe("validateConfig", function() { it("returns false if no files exist", function(done) { temp.mkdir("no-config", function(err, directory) { - if (err) throw err; + if (err) { throw err; } process.chdir(directory); @@ -24,7 +24,7 @@ describe("validateConfig", function() { it("returns true if an eslintrc exists", function(done) { temp.mkdir("config", function(err, directory) { - if (err) throw err; + if (err) { throw err; } process.chdir(directory); @@ -36,7 +36,7 @@ describe("validateConfig", function() { }; fs.writeFile(configPath, JSON.stringify(config), function(err) { - if (err) throw err; + if (err) { throw err; } expect(validateConfig(null)).to.eq(true); done();