diff --git a/lib/init.js b/lib/init.js index ba9fba8..01c3fd0 100644 --- a/lib/init.js +++ b/lib/init.js @@ -167,12 +167,14 @@ module.exports = { const linter = new (await getPugLint(projectDir))(); linter.configure(rules); - const results = linter.checkString(fileText); + const results = linter.checkString(fileText, filePath); return results.map(res => ({ - type: res.name, - filePath, - range: helpers.generateRange(textEditor, res.line - 1, res.column - 1), - text: res.msg, + severity: 'error', + location: { + file: res.filename, + position: helpers.generateRange(textEditor, res.line - 1, res.column - 1), + }, + excerpt: res.msg, })); }, }; diff --git a/spec/linter-stylint-spec.js b/spec/linter-stylint-spec.js index 51e57e0..0b07eb0 100644 --- a/spec/linter-stylint-spec.js +++ b/spec/linter-stylint-spec.js @@ -36,10 +36,10 @@ describe('The pug-lint provider for Linter', () => { const messages = await lint(editor); expect(messages.length).toEqual(1); - expect(messages[0].html).not.toBeDefined(); - expect(messages[0].text).toBe(errMsg); - expect(messages[0].filePath).toBe(badPug); - expect(messages[0].range).toEqual([[0, 13], [0, 20]]); + expect(messages[0].description).not.toBeDefined(); + expect(messages[0].excerpt).toBe(errMsg); + expect(messages[0].location.file).toBe(badPug); + expect(messages[0].location.position).toEqual([[0, 13], [0, 20]]); }); }); @@ -56,10 +56,10 @@ describe('The pug-lint provider for Linter', () => { const messages = await lint(editor); expect(messages.length).toEqual(1); - expect(messages[0].html).not.toBeDefined(); - expect(messages[0].text).toBe(errMsg); - expect(messages[0].filePath).toBe(noConfigSyntax); - expect(messages[0].range).toEqual([[1, 0], [1, 0]]); + expect(messages[0].description).not.toBeDefined(); + expect(messages[0].excerpt).toBe(errMsg); + expect(messages[0].location.file).toBe(noConfigSyntax); + expect(messages[0].location.position).toEqual([[1, 0], [1, 0]]); }); }); });