From 4d04146413e976304bb0e195f51d66cbc8cbdd58 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 13 Feb 2017 23:51:14 +0000 Subject: [PATCH 1/2] fix(package): update atom-linter to version 9.0.0 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c58fec3a..5a3b6843 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "compile": "npm run clean && babel src --out-dir lib" }, "dependencies": { - "atom-linter": "^8.0.0", + "atom-linter": "^9.0.0", "atom-package-deps": "^4.0.1", "consistent-path": "^2.0.1", "escape-html": "^1.0.3", From 9fe12ee2b54c37b0c889f157f7743e884d3814d7 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Mon, 13 Feb 2017 15:59:38 -0800 Subject: [PATCH 2/2] Rename rangeFromLineNumber to generateRange --- lib/helpers.js | 8 ++++---- src/helpers.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 4b049123..4dc49b44 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -113,7 +113,7 @@ let processESLintMessages = exports.processESLintMessages = (() => { msgEndCol = endColumn - 1; } else { // We want msgCol to remain undefined if it was initially so - // `rangeFromLineNumber` will give us a range over the entire line + // `generateRange` will give us a range over the entire line msgCol = typeof column !== 'undefined' ? column - 1 : column; } @@ -125,7 +125,7 @@ let processESLintMessages = exports.processESLintMessages = (() => { validatePoint(textEditor, msgEndLine, msgEndCol); range = [[msgLine, msgCol], [msgEndLine, msgEndCol]]; } else { - range = (0, _atomLinter.rangeFromLineNumber)(textEditor, msgLine, msgCol); + range = (0, _atomLinter.generateRange)(textEditor, msgLine, msgCol); } ret = { filePath, @@ -145,7 +145,7 @@ let processESLintMessages = exports.processESLintMessages = (() => { } } catch (err) { if (!err.message.startsWith('Line number ') && !err.message.startsWith('Column start ')) { - // This isn't an invalid point error from `rangeFromLineNumber`, re-throw it + // This isn't an invalid point error from `generateRange`, re-throw it throw err; } ret = yield generateInvalidTrace(msgLine, msgCol, msgEndLine, msgEndCol, eslintFullRange, filePath, textEditor, ruleId, message, worker); @@ -275,7 +275,7 @@ const generateInvalidTrace = (() => { severity: 'error', html: `${(0, _escapeHtml2.default)(titleText)}. See the trace for details. ` + `Report this!`, filePath, - range: (0, _atomLinter.rangeFromLineNumber)(textEditor, 0), + range: (0, _atomLinter.generateRange)(textEditor, 0), trace: [{ type: 'Trace', text: `Original message: ${ruleId} - ${message}`, diff --git a/src/helpers.js b/src/helpers.js index 0578a50c..36aeb56c 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -5,7 +5,7 @@ import { createFromProcess } from 'process-communication' import { join } from 'path' import escapeHTML from 'escape-html' import ruleURI from 'eslint-rule-documentation' -import { rangeFromLineNumber } from 'atom-linter' +import { generateRange } from 'atom-linter' // eslint-disable-next-line import/no-extraneous-dependencies, import/extensions import { Disposable, Range } from 'atom' @@ -151,7 +151,7 @@ const generateInvalidTrace = async ( html: `${escapeHTML(titleText)}. See the trace for details. ` + `Report this!`, filePath, - range: rangeFromLineNumber(textEditor, 0), + range: generateRange(textEditor, 0), trace: [ { type: 'Trace', @@ -214,7 +214,7 @@ export async function processESLintMessages(response, textEditor, showRule, work msgEndCol = endColumn - 1 } else { // We want msgCol to remain undefined if it was initially so - // `rangeFromLineNumber` will give us a range over the entire line + // `generateRange` will give us a range over the entire line msgCol = typeof column !== 'undefined' ? column - 1 : column } @@ -226,7 +226,7 @@ export async function processESLintMessages(response, textEditor, showRule, work validatePoint(textEditor, msgEndLine, msgEndCol) range = [[msgLine, msgCol], [msgEndLine, msgEndCol]] } else { - range = rangeFromLineNumber(textEditor, msgLine, msgCol) + range = generateRange(textEditor, msgLine, msgCol) } ret = { filePath, @@ -248,7 +248,7 @@ export async function processESLintMessages(response, textEditor, showRule, work if (!err.message.startsWith('Line number ') && !err.message.startsWith('Column start ') ) { - // This isn't an invalid point error from `rangeFromLineNumber`, re-throw it + // This isn't an invalid point error from `generateRange`, re-throw it throw err } ret = await generateInvalidTrace(