diff --git a/test/eslint-test-files/eslintignore/ignored.js b/test/eslint-test-files/eslintignore/ignored.js deleted file mode 100644 index 4ec1fa4..0000000 --- a/test/eslint-test-files/eslintignore/ignored.js +++ /dev/null @@ -1 +0,0 @@ -var foo = "bar"; diff --git a/test/handler/test_eslint_handler.vader b/test/handler/test_eslint_handler.vader index 7ac26c7..943e177 100644 --- a/test/handler/test_eslint_handler.vader +++ b/test/handler/test_eslint_handler.vader @@ -1,4 +1,11 @@ +Before: + Save g:ale_javascript_eslint_suppress_eslintignore + + let g:ale_javascript_eslint_suppress_eslintignore = 0 + After: + Restore + unlet! g:config_error_lines Execute(The eslint handler should parse lines correctly): @@ -206,3 +213,24 @@ Execute(The eslint hint about using typescript-eslint-parser): \ ale#handlers#eslint#Handle(bufnr(''), [ \ 'foo.ts:451:2: Parsing error: Unexpected token ) [Error]', \ ]) + +Execute(eslint should warn about ignored files by default): + 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 files when explicitly disabled): + let g:ale_javascript_eslint_suppress_eslintignore = 1 + + 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]', + \ ]) diff --git a/test/test_eslint_suppress_eslintignore.vader b/test/test_eslint_suppress_eslintignore.vader deleted file mode 100644 index 2893d21..0000000 --- a/test/test_eslint_suppress_eslintignore.vader +++ /dev/null @@ -1,38 +0,0 @@ -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]', - \ ])