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

Don't make any assumptions about output #39

Merged
merged 1 commit into from
Aug 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ module.exports =
if lintResult.messages.length < 1
return toReturn
for data in lintResult.messages
if not data.rollup
msg = {}
if not (data.line and data.col)
# Use the file start if location not defined
msg.range = helpers.rangeFromLineNumber(textEditor, 0)
else
line = data.line - 1
col = data.col - 1
else
helpers.rangeFromLineNumber(textEditor, 0)
toReturn.push({
type: data.type.charAt(0).toUpperCase() + data.type.slice(1),
text: data.message,
filePath: filePath
range: [[line, col], [line, col]],
trace: [{
msg.range = [[line, col], [line, col]]
msg.type = data.type.charAt(0).toUpperCase() + data.type.slice(1)
msg.text = data.message
msg.filePath = filePath
if data.rule.id and data.rule.desc
msg.trace = [{
type: "Trace",
text: '[' + data.rule.id + '] ' + data.rule.desc
}]
})
toReturn.push(msg)
return toReturn