From 3cababc83b1a229e296912851649771477cf2ebb Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 9 Mar 2017 21:05:00 +0000 Subject: Fix #386 report problems with eslint configuration files --- ale_linters/javascript/eslint.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ale_linters/javascript/eslint.vim') 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] -- cgit v1.2.3