Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sl4 compatibility #28

Merged
merged 1 commit into from
Jan 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

"""This module exports the Coffeelint plugin class."""

from SublimeLinter.lint import Linter, persist
import SublimeLinter
from SublimeLinter.lint import Linter, persist, util


class Coffeelint(Linter):
Expand All @@ -37,8 +38,14 @@ def cmd(self):
"""Return a tuple with the command line to execute."""

command = [self.executable_path, '--reporter', 'jslint', '--stdin']
api_version = getattr(SublimeLinter, 'VERSION', 3)

if persist.get_syntax(self.view) == 'coffeescript_literate':
if api_version > 3:
current_syntax = util.get_syntax(self.view)
else:
current_syntax = persist.get_syntax(self.view)

if current_syntax == 'coffeescript_literate':
command.append('--literate')

return command