from SublimeLinter.lint import NodeLinter

class XO(NodeLinter):
	npm_name = 'xo'
	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '@')
	regex = (
		r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
		r'(?:(?P<error>Error)|(?P<warning>Warning)) - '
		r'(?P<message>.+)'
	)
	defaults = {
		'selector': 'source.js - meta.attribute-with-value',
		'disable_if_not_dependency': True
	}

from SublimeLinter.lint import NodeLinter

class XO(NodeLinter):
	npm_name = 'xo'
	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '${file}')
	regex = (
		r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
		r'(?:(?P<error>Error)|(?P<warning>Warning)) - '
		r'(?P<message>.+)'
		r' \((?P<code>.+)\)$'
	)
	defaults = {
		'selector': 'source.js - meta.attribute-with-value',
		'disable_if_not_dependency': True
	}

Support the new SublimeLinter `code` property
Support the new SublimeLinter `code` property

  from SublimeLinter.lint import NodeLinter
  
  class XO(NodeLinter):
  	npm_name = 'xo'
- 	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '@')
+ 	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '${file}')
  	regex = (
  		r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
  		r'(?:(?P<error>Error)|(?P<warning>Warning)) - '
  		r'(?P<message>.+)'
+ 		r' \((?P<code>.+)\)$'
  	)
  	defaults = {
  		'selector': 'source.js - meta.attribute-with-value',
  		'disable_if_not_dependency': True
  	}
  
Support the new SublimeLinter `code` property
## Code Before:
from SublimeLinter.lint import NodeLinter

class XO(NodeLinter):
	npm_name = 'xo'
	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '@')
	regex = (
		r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
		r'(?:(?P<error>Error)|(?P<warning>Warning)) - '
		r'(?P<message>.+)'
	)
	defaults = {
		'selector': 'source.js - meta.attribute-with-value',
		'disable_if_not_dependency': True
	}

## Instruction:
Support the new SublimeLinter `code` property
## Code After:
from SublimeLinter.lint import NodeLinter

class XO(NodeLinter):
	npm_name = 'xo'
	cmd = ('xo', '--stdin', '--reporter', 'compact', '--filename', '${file}')
	regex = (
		r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
		r'(?:(?P<error>Error)|(?P<warning>Warning)) - '
		r'(?P<message>.+)'
		r' \((?P<code>.+)\)$'
	)
	defaults = {
		'selector': 'source.js - meta.attribute-with-value',
		'disable_if_not_dependency': True
	}
