From a4220b99a6f7a9184545e71f70bc280648dde586 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 29 Mar 2017 00:21:27 +0100 Subject: Fix #421 Automatically detect create-react-app paths --- ale_linters/javascript/eslint.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ale_linters/javascript/eslint.vim') diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim index ac88dd00..3bf88316 100644 --- a/ale_linters/javascript/eslint.vim +++ b/ale_linters/javascript/eslint.vim @@ -15,6 +15,17 @@ function! ale_linters#javascript#eslint#GetExecutable(buffer) abort return g:ale_javascript_eslint_executable endif + " Look for the kinds of paths that create-react-app generates first. + let l:executable = ale#util#ResolveLocalPath( + \ a:buffer, + \ 'node_modules/eslint/bin/eslint.js', + \ '' + \) + + if !empty(l:executable) + return l:executable + endif + return ale#util#ResolveLocalPath( \ a:buffer, \ 'node_modules/.bin/eslint', -- cgit v1.2.3