diff --git a/libraries/logger/.eslintrc b/libraries/logger/.eslintrc index 5ca14a0e9f..b0db54a22f 100644 --- a/libraries/logger/.eslintrc +++ b/libraries/logger/.eslintrc @@ -1,14 +1,10 @@ { "extends": [ "standard", - "standard-react", "prettier", - "prettier/react", - "prettier/standard", - "plugin:jsx-a11y/recommended" + "prettier/standard" ], "plugins": [ - "jsx-a11y", "mocha", "chai-expect", "chai-friendly" @@ -19,17 +15,8 @@ "globals": { "expect": true, "define": true, - "$": true, - "angular": true, - // Injected in layout.pug - "user_id": true, - "ace": true }, "settings": { - // Tell eslint-plugin-react to detect which version of React we are using - "react": { - "version": "detect" - } }, "rules": { "max-len": ["error", { @@ -38,24 +25,6 @@ "ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])" }], - // Fix conflict between prettier & standard by overriding to prefer - // double quotes - "jsx-quotes": ["error", "prefer-double"], - - // Override weird behaviour of jsx-a11y label-has-for (says labels must be - // nested *and* have for/id attributes) - "jsx-a11y/label-has-for": [ - "error", - { - "required": { - "some": [ - "nesting", - "id" - ] - } - } - ], - // Add some mocha specific rules "mocha/handle-done-callback": "error", "mocha/no-exclusive-tests": "error", diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 04e3bc18b2..63fb9fa942 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,7 +1,7 @@ const bunyan = require('bunyan') const request = require('request') -Logger = module.exports = { +const Logger = module.exports = { initialize(name) { this.isProduction = (process.env['NODE_ENV'] || '').toLowerCase() === 'production' @@ -50,6 +50,9 @@ Logger = module.exports = { }-setLogLevelEndTime` } request(options, (err, response, body) => { + if (err) { + return + } if (parseInt(body) > Date.now()) { this.logger.level('trace') } else { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 92f5a4dd81..381905ff23 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -10,7 +10,8 @@ "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", - "format:fix": "prettier-eslint '**/*.js' --write" + "format:fix": "prettier-eslint '**/*.js' --write", + "lint": "eslint -f unix ." }, "dependencies": { "bunyan": "1.8.12", @@ -19,6 +20,16 @@ }, "devDependencies": { "chai": "4.2.0", + "eslint": "^4.18.1", + "eslint-config-prettier": "^3.1.0", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-chai-expect": "^1.1.1", + "eslint-plugin-chai-friendly": "^0.4.1", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-mocha": "^5.2.0", + "eslint-plugin-node": "^6.0.0", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-standard": "^3.0.1", "mocha": "5.2.0", "sandboxed-module": "2.0.3", "sinon": "7.2.3",