diff options
author | w0rp <devw0rp@gmail.com> | 2017-03-09 21:05:00 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-03-09 21:05:00 +0000 |
commit | 3cababc83b1a229e296912851649771477cf2ebb (patch) | |
tree | fca1b56d88e236edb0ae16105c9aff5a104aebed /ale_linters/javascript/eslint.vim | |
parent | fc072a07727865b664dbaaad582b20c0d48c904e (diff) | |
download | ale-3cababc83b1a229e296912851649771477cf2ebb.zip |
Fix #386 report problems with eslint configuration files
Diffstat (limited to 'ale_linters/javascript/eslint.vim')
-rw-r--r-- | ale_linters/javascript/eslint.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim index baca3dd2..ac88dd00 100644 --- a/ale_linters/javascript/eslint.vim +++ b/ale_linters/javascript/eslint.vim @@ -29,6 +29,21 @@ function! ale_linters#javascript#eslint#GetCommand(buffer) abort endfunction function! ale_linters#javascript#eslint#Handle(buffer, lines) abort + let l:config_error_pattern = '\v^ESLint couldn''t find a configuration file' + \ . '|^Cannot read config file' + + " Look for a message in the first few lines which indicates that + " a configuration file couldn't be found. + for l:line in a:lines[:10] + if len(matchlist(l:line, l:config_error_pattern)) > 0 + return [{ + \ 'lnum': 1, + \ 'text': 'eslint configuration error (type :ALEDetail for more information)', + \ 'detail': join(a:lines, "\n"), + \}] + endif + endfor + " Matches patterns line the following: " " /path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle] |