#852 Capture error codes for ESLint

This commit is contained in:
w0rp 2017-11-13 23:21:45 +00:00
parent 764a33b1c9
commit 8a3a2da87e
2 changed files with 30 additions and 19 deletions

View file

@ -19,13 +19,15 @@ Execute(The eslint handler should parse lines correctly):
\ {
\ 'lnum': 47,
\ 'col': 14,
\ 'text': 'Missing trailing comma. [Warning/comma-dangle]',
\ 'text': 'Missing trailing comma.',
\ 'code': 'comma-dangle',
\ 'type': 'W',
\ },
\ {
\ 'lnum': 56,
\ 'col': 41,
\ 'text': 'Missing semicolon. [Error/semi]',
\ 'text': 'Missing semicolon.',
\ 'code': 'semi',
\ 'type': 'E',
\ },
\ {
@ -259,42 +261,47 @@ Execute(The eslint handler should output end_col values where appropriate):
\ 'lnum': 4,
\ 'col': 3,
\ 'end_col': 15,
\ 'text': 'Parsing error: Unexpected token ''some string'' [Error]',
\ 'text': 'Parsing error: Unexpected token ''some string''',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 70,
\ 'col': 3,
\ 'end_col': 5,
\ 'text': '''foo'' is not defined. [Error/no-undef]',
\ 'text': '''foo'' is not defined.',
\ 'code': 'no-undef',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 71,
\ 'col': 2,
\ 'end_col': 6,
\ 'text': 'Unexpected `await` inside a loop. [Error/no-await-in-loop]',
\ 'text': 'Unexpected `await` inside a loop.',
\ 'code': 'no-await-in-loop',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 72,
\ 'col': 6,
\ 'end_col': 10,
\ 'text': 'Redundant use of `await` on a return value. [Error/no-return-await]',
\ 'text': 'Redundant use of `await` on a return value.',
\ 'code': 'no-return-await',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 73,
\ 'col': 4,
\ 'end_col': 10,
\ 'text': 'Unexpected console statement [Error/no-console]',
\ 'text': 'Unexpected console statement',
\ 'code': 'no-console',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 74,
\ 'col': 4,
\ 'end_col': 11,
\ 'text': 'Unexpected ''debugger'' statement. [Error/no-debugger]',
\ 'text': 'Unexpected ''debugger'' statement.',
\ 'code': 'no-debugger',
\ 'type': 'E',
\ },
\ ],
@ -316,7 +323,7 @@ Execute(The eslint hint about using typescript-eslint-parser):
\ 'lnum': 451,
\ 'col': 2,
\ 'end_col': 2,
\ 'text': 'Parsing error (You may need configure typescript-eslint-parser): Unexpected token ) [Error]',
\ 'text': 'Parsing error (You may need configure typescript-eslint-parser): Unexpected token )',
\ 'type': 'E',
\ },
\ ],
@ -330,7 +337,7 @@ Execute(eslint should warn about ignored files by default):
\ 'lnum': 0,
\ 'col': 0,
\ 'type': 'W',
\ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]'
\ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
\ }],
\ ale#handlers#eslint#Handle(bufnr(''), [
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',