From 192925d6f8b7c1636993c2f61504b93534d6c396 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Mon, 10 Oct 2016 10:15:22 -0700 Subject: [PATCH] Fix lint issue Also updates compiled code, since `babel` changed it's mind again. --- lib/helpers.js | 4 ++-- lib/main.js | 5 ++++- src/main.js | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 806e2d51..39aec3ad 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -50,7 +50,7 @@ function spawnWorker() { } function showError(givenMessage) { - var givenDetail = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var givenDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var detail = void 0; var message = void 0; @@ -68,7 +68,7 @@ function showError(givenMessage) { } function idsToIgnoredRules() { - var ruleIds = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + var ruleIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; return ruleIds.reduce(function (ids, id) { ids[id] = RULE_OFF_SEVERITY; diff --git a/lib/main.js b/lib/main.js index babf977d..cd4c98e4 100644 --- a/lib/main.js +++ b/lib/main.js @@ -75,6 +75,7 @@ module.exports = { 'linter-eslint:debug': function linterEslintDebug() { var textEditor = atom.workspace.getActiveTextEditor(); var filePath = textEditor.getPath(); + // eslint-disable-next-line import/no-dynamic-require var linterEslintMeta = require(_path2.default.join(atom.packages.resolvePackagePath('linter-eslint'), 'package.json')); var config = atom.config.get('linter-eslint'); var configString = JSON.stringify(config, null, 2); @@ -84,7 +85,9 @@ module.exports = { config: config, filePath: filePath }).then(function (response) { - var detail = ['atom version: ' + atom.getVersion(), 'linter-eslint version: ' + linterEslintMeta.version, 'eslint version: ' + require(_path2.default.join(response.path, 'package.json')).version, 'hours since last atom restart: ' + Math.round(hoursSinceRestart * 10) / 10, 'platform: ' + process.platform, 'Using ' + response.type + ' eslint from ' + response.path, 'linter-eslint configuration: ' + configString].join('\n'); + var detail = ['atom version: ' + atom.getVersion(), 'linter-eslint version: ' + linterEslintMeta.version, + // eslint-disable-next-line import/no-dynamic-require + 'eslint version: ' + require(_path2.default.join(response.path, 'package.json')).version, 'hours since last atom restart: ' + Math.round(hoursSinceRestart * 10) / 10, 'platform: ' + process.platform, 'Using ' + response.type + ' eslint from ' + response.path, 'linter-eslint configuration: ' + configString].join('\n'); var notificationOptions = { detail: detail, dismissable: true }; atom.notifications.addInfo('linter-eslint debugging information', notificationOptions); }).catch(function (response) { diff --git a/src/main.js b/src/main.js index 149adccd..f120032d 100644 --- a/src/main.js +++ b/src/main.js @@ -65,6 +65,7 @@ module.exports = { 'linter-eslint:debug': () => { const textEditor = atom.workspace.getActiveTextEditor() const filePath = textEditor.getPath() + // eslint-disable-next-line import/no-dynamic-require const linterEslintMeta = require(Path.join(atom.packages.resolvePackagePath('linter-eslint'), 'package.json')) const config = atom.config.get('linter-eslint') const configString = JSON.stringify(config, null, 2) @@ -77,6 +78,7 @@ module.exports = { const detail = [ `atom version: ${atom.getVersion()}`, `linter-eslint version: ${linterEslintMeta.version}`, + // eslint-disable-next-line import/no-dynamic-require `eslint version: ${require(Path.join(response.path, 'package.json')).version}`, `hours since last atom restart: ${Math.round(hoursSinceRestart * 10) / 10}`, `platform: ${process.platform}`,