Skip to content

Commit b315667

Browse files
committed
Fix #2192 - Handle more ignore-pattern messages for ESLint
1 parent 0495a8b commit b315667

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

autoload/ale/handlers/eslint.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function! ale#handlers#eslint#Handle(buffer, lines) abort
121121
let l:text = l:match[3]
122122

123123
if ale#Var(a:buffer, 'javascript_eslint_suppress_eslintignore')
124-
if l:text is# 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
124+
if l:text =~# '^File ignored'
125125
continue
126126
endif
127127
endif

test/handler/test_eslint_handler.vader

+17
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,17 @@ Execute(eslint should warn about ignored files by default):
342342
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
343343
\ ])
344344

345+
AssertEqual
346+
\ [{
347+
\ 'lnum': 0,
348+
\ 'col': 0,
349+
\ 'type': 'W',
350+
\ 'text': 'File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override.',
351+
\ }],
352+
\ ale#handlers#eslint#Handle(bufnr(''), [
353+
\ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
354+
\ ])
355+
345356
Execute(eslint should not warn about ignored files when explicitly disabled):
346357
let g:ale_javascript_eslint_suppress_eslintignore = 1
347358

@@ -351,6 +362,12 @@ Execute(eslint should not warn about ignored files when explicitly disabled):
351362
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
352363
\ ])
353364

365+
AssertEqual
366+
\ [],
367+
\ ale#handlers#eslint#Handle(bufnr(''), [
368+
\ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
369+
\ ])
370+
354371
Execute(eslint should handle react errors correctly):
355372
AssertEqual
356373
\ [

0 commit comments

Comments
 (0)