import logging
import re
from SublimeLinter.lint import NodeLinter

logger = logging.getLogger('SublimeLinter.plugin.tslint')


class Tslint(NodeLinter):
    cmd = 'tslint --format verbose ${file}'
    regex = (
        r'^(?:'
        r'(ERROR:\s+\((?P<error>.*)\))|'
        r'(WARNING:\s+\((?P<warning>.*)\))'
        r')?'
        r'.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    tempfile_suffix = '-'
    defaults = {
        'selector': 'source.ts, source.tsx'
    }

    def on_stderr(self, stderr):
        # suppress warnings like "rule requires type information"

        stderr = re.sub(
            'Warning: .+\n', '', stderr)

        if stderr:
            self.notify_failure()
            logger.error(stderr)

import logging
import re
from SublimeLinter.lint import NodeLinter

logger = logging.getLogger('SublimeLinter.plugin.tslint')


class Tslint(NodeLinter):
    cmd = 'tslint --format verbose ${file}'
    regex = (
        r'^(?:'
        r'(ERROR:\s+\((?P<error>.*)\))|'
        r'(WARNING:\s+\((?P<warning>.*)\))'
        r')?'
        r'\s+(?P<filename>.+?)'
        r'\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    tempfile_suffix = '-'
    defaults = {
        'selector': 'source.ts, source.tsx'
    }

    def on_stderr(self, stderr):
        # suppress warnings like "rule requires type information"

        stderr = re.sub(
            'Warning: .+\n', '', stderr)

        if stderr:
            self.notify_failure()
            logger.error(stderr)

Update regex to include filename capture group.
Update regex to include filename capture group.

  import logging
  import re
  from SublimeLinter.lint import NodeLinter
  
  logger = logging.getLogger('SublimeLinter.plugin.tslint')
  
  
  class Tslint(NodeLinter):
      cmd = 'tslint --format verbose ${file}'
      regex = (
          r'^(?:'
          r'(ERROR:\s+\((?P<error>.*)\))|'
          r'(WARNING:\s+\((?P<warning>.*)\))'
          r')?'
+         r'\s+(?P<filename>.+?)'
-         r'.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
+         r'\[(?P<line>\d+), (?P<col>\d+)\]: '
          r'(?P<message>.+)'
      )
      tempfile_suffix = '-'
      defaults = {
          'selector': 'source.ts, source.tsx'
      }
  
      def on_stderr(self, stderr):
          # suppress warnings like "rule requires type information"
  
          stderr = re.sub(
              'Warning: .+\n', '', stderr)
  
          if stderr:
              self.notify_failure()
              logger.error(stderr)
  
Update regex to include filename capture group.
## Code Before:
import logging
import re
from SublimeLinter.lint import NodeLinter

logger = logging.getLogger('SublimeLinter.plugin.tslint')


class Tslint(NodeLinter):
    cmd = 'tslint --format verbose ${file}'
    regex = (
        r'^(?:'
        r'(ERROR:\s+\((?P<error>.*)\))|'
        r'(WARNING:\s+\((?P<warning>.*)\))'
        r')?'
        r'.+?\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    tempfile_suffix = '-'
    defaults = {
        'selector': 'source.ts, source.tsx'
    }

    def on_stderr(self, stderr):
        # suppress warnings like "rule requires type information"

        stderr = re.sub(
            'Warning: .+\n', '', stderr)

        if stderr:
            self.notify_failure()
            logger.error(stderr)

## Instruction:
Update regex to include filename capture group.
## Code After:
import logging
import re
from SublimeLinter.lint import NodeLinter

logger = logging.getLogger('SublimeLinter.plugin.tslint')


class Tslint(NodeLinter):
    cmd = 'tslint --format verbose ${file}'
    regex = (
        r'^(?:'
        r'(ERROR:\s+\((?P<error>.*)\))|'
        r'(WARNING:\s+\((?P<warning>.*)\))'
        r')?'
        r'\s+(?P<filename>.+?)'
        r'\[(?P<line>\d+), (?P<col>\d+)\]: '
        r'(?P<message>.+)'
    )
    tempfile_suffix = '-'
    defaults = {
        'selector': 'source.ts, source.tsx'
    }

    def on_stderr(self, stderr):
        # suppress warnings like "rule requires type information"

        stderr = re.sub(
            'Warning: .+\n', '', stderr)

        if stderr:
            self.notify_failure()
            logger.error(stderr)
