Skip to content

Commit

Permalink
eslint 4 compat fixes (#13)
Browse files Browse the repository at this point in the history
* eslint 4 compat fixes

fixes #12

* add node v8, drop v4
  • Loading branch information
msimerson authored Jun 17, 2017
1 parent a033fc5 commit 102b9ad
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 28 deletions.
23 changes: 5 additions & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
{
"plugins": [
"haraka"
],
"extends": ["eslint:recommended", "plugin:haraka/recommended"],
"env": {
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"installedESLint": true,
"root": true,
"rules": {
"comma-dangle": [2, "only-multiline"],
"dot-notation": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"one-var": [2, "never"],
"no-trailing-spaces": [2, { "skipBlankLines": false }],
"keyword-spacing": [2, {
"before": true,
"after": true
}],
"no-delete-var": 2,
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-label-var": 2,
"no-shadow": 2,
"no-unused-vars": [ 1, { "args": "none" }],
"no-console": 0
"indent": [2, 2, {"SwitchCase": 1}]
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- "4"
- "6"
- "8"

before_script:

Expand Down
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

1.0.8 - 2017-06-16

* depend on haraka-eslint for rules
* lint fixes

1.0.7 - 2017-05-04

* add --text flag to grep call, in case log file has binary chars
Expand Down
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ exports.load_karma_ini = function () {

Object.keys(plugin.karma_cfg.result_awards).forEach(function (anum) {
var parts = plugin.karma_cfg.result_awards[anum]
.replace(/\s+/, ' ')
.split(/(?:\s*\|\s*)/);
.replace(/\s+/, ' ')
.split(/(?:\s*\|\s*)/);

plugin.result_awards[anum] = {
pi_name : parts[0],
property : parts[1],
Expand All @@ -59,7 +60,7 @@ exports.get_rules = function (req, res) {

exports.get_logs = function (req, res) {

var uuid = req.params.uuid;
let uuid = req.params.uuid;
if (!/\-/.test(uuid)) {
return res.send('<html><body>Invalid Request</body></html>');
}
Expand Down Expand Up @@ -206,7 +207,6 @@ function sortByAward (a, b) {
}

function htmlHead () {
/* jshint multistr: true */
var str = '<html> \
<head> \
<meta charset="utf-8"> \
Expand All @@ -220,7 +220,6 @@ function htmlHead () {
}

function htmlBody (uuid, awards, resolve) {
/* jshint multistr: true */
var str = '<body> \
<div class="tab-content"> \
<h3>Sorry we blocked your message:</h3> \
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-log-reader",
"version": "1.0.7",
"version": "1.0.8",
"description": "display log entries from haraka log files via HTTP",
"main": "index.js",
"scripts": {
Expand All @@ -26,6 +26,7 @@
"homepage": "https://github.com/haraka/haraka-plugin-log-reader#readme",
"devDependencies": {
"eslint": "*",
"eslint-plugin-haraka": "*",
"haraka-test-fixtures": "*",
"mocha": "*"
}
Expand Down
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('register', function () {

it('runs', function (done) {
attach.register();
// console.log(attach.cfg);
// console.log(attach.cfg);
done();
});

Expand Down Expand Up @@ -50,7 +50,7 @@ describe('log.reader.ini', function () {
});
});

describe('grepWithShell', function() {
describe('grepWithShell', function () {
it('reads matching connection entries from a log file', function (done) {
var reader = new fixtures.plugin('index');
reader.register();
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('grepWithShell', function() {
// the subsequent functions require the express res/req
// those could be mocked up, along with some sample log files

describe('get_rules', function() {
describe('get_rules', function () {
it.skip('returns rules section from karma.ini', function (done) {
done();
})
Expand Down

0 comments on commit 102b9ad

Please sign in to comment.