Skip to content

Commit

Permalink
Merge pull request #1 from kaste/patch-1
Browse files Browse the repository at this point in the history
Fail for untitled buffers
  • Loading branch information
sambauers authored May 7, 2021
2 parents 6efc529 + 42b03e4 commit a258fd9
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@

class TSStandard(NodeLinter):
name = 'ts-standard'
cmd = 'ts-standard --stdin --stdin-filename ${file}'
regex = r'^.+:(?P<line>\d+):(?P<col>\d+):\s*(?P<message>.+)'
multiline = True
defaults = {
'selector': 'source.ts, source.tsx',
'disable_if_not_dependency': False
}

def cmd(self):
if self.context.get('file'):
return (
'ts-standard',
'--stdin',
'--stdin-filename',
'${file}'
)

self.notify_failure()
return (
'echo',
'<buffer>:1:1:The file must be saved before it can be linted by ts-standard'
)
def run(self, cmd, code):
if not self.context.get('file'):
self.notify_failure()
return '-:1:1:The file must be saved before it can be linted by ts-standard'
return super().run(cmd, code)

0 comments on commit a258fd9

Please sign in to comment.