Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
- Update eslint configuration
- Reduce complexity via temporary variable
- Consistent brace style

Extracted from #109
  • Loading branch information
GarthDB authored and pbrisbin committed Aug 17, 2016
1 parent 40884b0 commit 7a83b53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Expand Up @@ -15,6 +15,7 @@
"no-use-before-define": 2,
"radix": 2,
"semi": 2,
"block-spacing": 2,
"space-infix-ops": 2,
"strict": 0
},
Expand Down
10 changes: 6 additions & 4 deletions bin/eslint.js
Expand Up @@ -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",
Expand All @@ -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
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions test/validate_config_test.js
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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();
Expand Down

0 comments on commit 7a83b53

Please sign in to comment.