Suppress warning about .eslintignore'd file (#836)

* Suppress warning about .eslintignore'd file

* Fix slightly ironic lint error

* Lock error suppression behind a variable; add docs and tests
This commit is contained in:
Eric Stern
2017-08-22 13:35:09 -07:00
committed by w0rp
parent 1a524ca63e
commit 2f19cf874b
4 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1 @@
var foo = "bar";

View File

@@ -0,0 +1,38 @@
Before:
Save g:ale_javascript_eslint_suppress_eslintignore
call ale#test#SetDirectory('/testplugin/test')
runtime ale_linters/javascript/eslint.vim
After:
Restore
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(eslint should warn about ignored file):
call ale#test#SetFilename('eslint-test-files/eslintignore/ignore.js')
AssertEqual
\ [{
\ 'lnum': 0,
\ 'col': 0,
\ 'type': 'W',
\ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]'
\ }],
\ ale#handlers#eslint#Handle(347, [
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
\ ])
Execute(eslint should not warn about ignored file when configured):
let g:ale_javascript_eslint_suppress_eslintignore = 1
call ale#test#SetFilename('eslint-test-files/eslintignore/ignore.js')
AssertEqual
\ [],
\ ale#handlers#eslint#Handle(347, [
\ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
\ ])