diff --git a/lib/worker.js b/lib/worker.js index f161f518..dffa0937 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -20,8 +20,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de process.title = 'linter-eslint helper'; -var ignoredMessageV1 = 'File ignored because of your .eslintignore file. Use --no-ignore to override.'; -var ignoredMessageV2 = 'File ignored because of a matching ignore pattern. Use --no-ignore to override.'; +var ignoredMessages = [ +// V1 +'File ignored because of your .eslintignore file. Use --no-ignore to override.', +// V2 +'File ignored because of a matching ignore pattern. Use --no-ignore to override.', +// V2.11.1 +'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.']; function lintJob(argv, contents, eslint, configPath, config) { if (configPath === null && config.disableWhenNoEslintConfig) { @@ -29,9 +34,7 @@ function lintJob(argv, contents, eslint, configPath, config) { } eslint.execute(argv, contents); return global.__LINTER_ESLINT_RESPONSE.filter(function (e) { - return e.message !== ignoredMessageV1; - }).filter(function (e) { - return e.message !== ignoredMessageV2; + return !ignoredMessages.includes(e.message); }); } function fixJob(argv, eslint) { diff --git a/package.json b/package.json index 87de958a..1a1bd35c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "atom-package-deps": "^4.0.1", "consistent-path": "^2.0.1", "escape-html": "^1.0.3", - "eslint": "^2.9.0", + "eslint": "^2.11.1", "process-communication": "^1.1.0", "resolve-env": "^1.0.0" }, diff --git a/src/worker.js b/src/worker.js index ac92290d..1e018115 100644 --- a/src/worker.js +++ b/src/worker.js @@ -7,10 +7,14 @@ import * as Helpers from './worker-helpers' import { create } from 'process-communication' import { FindCache } from 'atom-linter' -const ignoredMessageV1 = - 'File ignored because of your .eslintignore file. Use --no-ignore to override.' -const ignoredMessageV2 = - 'File ignored because of a matching ignore pattern. Use --no-ignore to override.' +const ignoredMessages = [ + // V1 + 'File ignored because of your .eslintignore file. Use --no-ignore to override.', + // V2 + 'File ignored because of a matching ignore pattern. Use --no-ignore to override.', + // V2.11.1 + 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.', +] function lintJob(argv, contents, eslint, configPath, config) { if (configPath === null && config.disableWhenNoEslintConfig) { @@ -18,8 +22,7 @@ function lintJob(argv, contents, eslint, configPath, config) { } eslint.execute(argv, contents) return global.__LINTER_ESLINT_RESPONSE - .filter(e => e.message !== ignoredMessageV1) - .filter(e => e.message !== ignoredMessageV2) + .filter(e => !ignoredMessages.includes(e.message)) } function fixJob(argv, eslint) { try {