Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint updates for eslint 4 #22

Merged
merged 1 commit into from
Jun 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
],
"extends": ["eslint:recommended", "plugin:haraka/recommended"],
"rules": {
"no-console": 0
}
}
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 1.0.13 - 2017-06-16

- lint updates for eslint 4

# 1.0.12 - 2017-05-21

- unref() the setInterval so that Haraka can gracefully exit
Expand Down
34 changes: 17 additions & 17 deletions configfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,24 +268,24 @@ cfreader.read_dir = function (name, opts, done) {
var type = opts.type || 'binary';

isDirectory(name)
.then((result) => {
return fsReadDir(name);
})
.then((result2) => {
var reader = require('./readers/' + type);
var promises = [];
result2.forEach(function (file) {
promises.push(reader.loadPromise(path.resolve(name, file)))
});
return Promise.all(promises);
})
.then((fileList) => {
.then((result) => {
return fsReadDir(name);
})
.then((result2) => {
var reader = require('./readers/' + type);
var promises = [];
result2.forEach(function (file) {
promises.push(reader.loadPromise(path.resolve(name, file)))
});
return Promise.all(promises);
})
.then((fileList) => {
// console.log(fileList);
done(null, fileList);
})
.catch((error) => {
done(error);
})
done(null, fileList);
})
.catch((error) => {
done(error);
})

if (opts.watchCb) fsWatchDir(name);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "haraka-config",
"license": "MIT",
"description": "Haraka's config file loader",
"version": "1.0.12",
"version": "1.0.13",
"homepage": "http://haraka.github.io",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions test/readers/flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ exports.load = {
'loads the test flat file, as list': function (test) {
test.expect(1);
var result = this.flat.load(
'test/config/test.flat', 'list', null, regex);
'test/config/test.flat', 'list', null, regex);
test.deepEqual(result, [ 'line1', 'line2', 'line3', 'line5' ]);
test.done();
},
'loads the test flat file, unspecified type': function (test) {
test.expect(1);
var result = this.flat.load(
'test/config/test.flat', null, null, regex);
'test/config/test.flat', null, null, regex);
test.deepEqual(result, 'line1');
test.done();
},
Expand Down
54 changes: 27 additions & 27 deletions test/readers/ini.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,53 +103,53 @@ exports.empty = {
'non-exist.ini boolean' : function (test) {
test.expect(1);
test.deepEqual(
this.ini.empty({ booleans: ['reject']}),
{ main: { reject: false } }
);
this.ini.empty({ booleans: ['reject']}),
{ main: { reject: false } }
);
test.done();
},
'non-exist.ini boolean true default' : function (test) {
test.expect(3);
test.deepEqual(
this.ini.empty({ booleans: ['+reject']}),
{ main: { reject: true } }
);
this.ini.empty({ booleans: ['+reject']}),
{ main: { reject: true } }
);
test.deepEqual(
this.ini.empty({ booleans: ['+main.reject']}),
{ main: { reject: true } }
);
this.ini.empty({ booleans: ['+main.reject']}),
{ main: { reject: true } }
);
test.deepEqual(
this.ini.empty({ booleans: ['main.+reject']}),
{ main: { reject: true } }
);
this.ini.empty({ booleans: ['main.+reject']}),
{ main: { reject: true } }
);
test.done();
},
'non-exist.ini boolean false default' : function (test) {
test.expect(3);
test.deepEqual(
this.ini.empty({ booleans: ['-reject']}),
{ main: { reject: false } }
);
this.ini.empty({ booleans: ['-reject']}),
{ main: { reject: false } }
);
test.deepEqual(
this.ini.empty({ booleans: ['-main.reject']}),
{ main: { reject: false } }
);
this.ini.empty({ booleans: ['-main.reject']}),
{ main: { reject: false } }
);
test.deepEqual(
this.ini.empty({ booleans: ['main.-reject']}),
{ main: { reject: false } }
);
this.ini.empty({ booleans: ['main.-reject']}),
{ main: { reject: false } }
);
test.done();
},
'non-exist.ini boolean false default, section' : function (test) {
test.expect(2);
test.deepEqual(
this.ini.empty({ booleans: ['-reject.boolf']}),
{ main: { }, reject: {boolf: false} }
);
this.ini.empty({ booleans: ['-reject.boolf']}),
{ main: { }, reject: {boolf: false} }
);
test.deepEqual(
this.ini.empty({ booleans: ['+reject.boolt']}),
{ main: { }, reject: {boolt: true} }
);
this.ini.empty({ booleans: ['+reject.boolt']}),
{ main: { }, reject: {boolt: true} }
);
test.done();
},
};
Expand Down