diff --git a/.eslintrc b/.eslintrc index e3e78971b..2c21d4e29 100644 --- a/.eslintrc +++ b/.eslintrc @@ -15,6 +15,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..97dd35dad 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 } } }, 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();