summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-29 00:21:27 +0100
committerw0rp <devw0rp@gmail.com>2017-03-29 00:21:27 +0100
commita4220b99a6f7a9184545e71f70bc280648dde586 (patch)
treeeb63c7d6b677574c15a45ecaf8d7b748041f38f9 /ale_linters
parent4b9b4e3338187d3bee37a11f3e7b3777533fa703 (diff)
downloadale-a4220b99a6f7a9184545e71f70bc280648dde586.zip
Fix #421 Automatically detect create-react-app paths
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/javascript/eslint.vim11
1 files changed, 11 insertions, 0 deletions
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',