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

from SublimeLinter.lint import Linter, util


class Tslint(Linter):

    """Provides an interface to tslint."""

    syntax = 'typescript'
    cmd = ('tslint', '@')
    regex = (
        r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    error_stream = util.STREAM_BOTH
    config_file = ('--config', 'tslint.json', '~')
    tempfile_suffix = 'ts'
    version_args = '--version'
    version_requirement = '>= 0.4.0'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'


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

from SublimeLinter.lint import Linter, util


class Tslint(Linter):

    """Provides an interface to tslint."""

    syntax = ('typescript', 'typescriptreact')
    cmd = ('tslint', '@')
    regex = (
        r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    error_stream = util.STREAM_BOTH
    config_file = ('--config', 'tslint.json', '~')
    tempfile_suffix = {'typescript': 'ts', 'typescriptreact': 'tsx'}
    version_args = '--version'
    version_requirement = '>= 0.4.0'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'

Add support for typescriptreact *.tsx files
Add support for typescriptreact *.tsx files
  
  """This module exports the Tslint plugin class."""
  
  from SublimeLinter.lint import Linter, util
  
  
  class Tslint(Linter):
  
      """Provides an interface to tslint."""
  
-     syntax = 'typescript'
+     syntax = ('typescript', 'typescriptreact')
      cmd = ('tslint', '@')
      regex = (
          r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
          r'(?P<message>.+)'
      )
      error_stream = util.STREAM_BOTH
      config_file = ('--config', 'tslint.json', '~')
-     tempfile_suffix = 'ts'
+     tempfile_suffix = {'typescript': 'ts', 'typescriptreact': 'tsx'}
      version_args = '--version'
      version_requirement = '>= 0.4.0'
      version_re = r'(?P<version>\d+\.\d+\.\d+)'
  
Add support for typescriptreact *.tsx files
## Code Before:

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

from SublimeLinter.lint import Linter, util


class Tslint(Linter):

    """Provides an interface to tslint."""

    syntax = 'typescript'
    cmd = ('tslint', '@')
    regex = (
        r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    error_stream = util.STREAM_BOTH
    config_file = ('--config', 'tslint.json', '~')
    tempfile_suffix = 'ts'
    version_args = '--version'
    version_requirement = '>= 0.4.0'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'

## Instruction:
Add support for typescriptreact *.tsx files
## Code After:

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

from SublimeLinter.lint import Linter, util


class Tslint(Linter):

    """Provides an interface to tslint."""

    syntax = ('typescript', 'typescriptreact')
    cmd = ('tslint', '@')
    regex = (
        r'^.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    error_stream = util.STREAM_BOTH
    config_file = ('--config', 'tslint.json', '~')
    tempfile_suffix = {'typescript': 'ts', 'typescriptreact': 'tsx'}
    version_args = '--version'
    version_requirement = '>= 0.4.0'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
