Skip to content

Commit

Permalink
fix issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardofbarros committed May 8, 2015
1 parent d88161c commit 698849b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/linter-js-standard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class LinterJsStandard extends Linter

# A regex pattern used to extract information from the executable's output.
regex:
'^((?!.*?eslint\/undefined.*?)' +
'((?<file>.*?\\..*?(?=:))' +
'(:(?<line>[0-9]+):(?<col>[0-9]+):'+
'(?<message>.+)((?<error>\\(jscs\/parseError\\))|(?<warning>\\(.*\\))))))$'
'^(?<file>.*?\\..*?(?=:))' +
':(?<line>[0-9]+):(?<col>[0-9]+):' +
'((?<message>.*?(?=\\())((?<error>.+undefined.*?)|(?<warning>.*?)))$'

regexFlags: 'gm'

Expand Down Expand Up @@ -69,15 +68,12 @@ class LinterJsStandard extends Linter


formatMessage: (match) ->
type = if match.error
"E"
else if match.warning
"W"
else
if !match.error && !match.warning
warn "Regex does not match lint output", match
""

"#{match.message} (#{type})"
## Dunno why I need to do this
## but if I dont it doesnt show a message
"#{match.message}"

destroy: ->
atom.config.unobserve 'linter-js-standard.jsStandardExecutablePath'
Expand Down

0 comments on commit 698849b

Please sign in to comment.