summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-01-27 12:08:31 +0000
committerw0rp <devw0rp@gmail.com>2019-01-27 12:10:03 +0000
commitb315667ebebb9995e05d72ecba7497dc94839b43 (patch)
tree7a3549c0b3571ffb73af7a53c29b894b3b603158
parent0495a8be20719afd80020e4abf863ff901eca834 (diff)
downloadale-b315667ebebb9995e05d72ecba7497dc94839b43.zip
Fix #2192 - Handle more ignore-pattern messages for ESLint
-rw-r--r--autoload/ale/handlers/eslint.vim2
-rw-r--r--test/handler/test_eslint_handler.vader17
2 files changed, 18 insertions, 1 deletions
diff --git a/autoload/ale/handlers/eslint.vim b/autoload/ale/handlers/eslint.vim
index eda033e4..bc7c0321 100644
--- a/autoload/ale/handlers/eslint.vim
+++ b/autoload/ale/handlers/eslint.vim
@@ -121,7 +121,7 @@ function! ale#handlers#eslint#Handle(buffer, lines) abort
let l:text = l:match[3]
if ale#Var(a:buffer, 'javascript_eslint_suppress_eslintignore')
- if l:text is# 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
+ if l:text =~# '^File ignored'
continue
endif
endif
diff --git a/test/handler/test_eslint_handler.vader b/test/handler/test_eslint_handler.vader
index 4a57927b..1bb438a6 100644
--- a/test/handler/test_eslint_handler.vader
+++ b/test/handler/test_eslint_handler.vader
@@ -342,6 +342,17 @@ Execute(eslint should warn about ignored files by default):
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
\ ])
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override.',
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
+ \ ])
+
Execute(eslint should not warn about ignored files when explicitly disabled):
let g:ale_javascript_eslint_suppress_eslintignore = 1
@@ -351,6 +362,12 @@ Execute(eslint should not warn about ignored files when explicitly disabled):
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
\ ])
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
+ \ ])
+
Execute(eslint should handle react errors correctly):
AssertEqual
\ [