Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Fix lint issue
Browse files Browse the repository at this point in the history
Also updates compiled code, since `babel` changed it's mind again.
  • Loading branch information
Arcanemagus committed Oct 10, 2016
1 parent 9d2eae6 commit c3f605b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}`,
Expand Down

0 comments on commit c3f605b

Please sign in to comment.