ale/autoload/ale
Kevin Locke 26e61fad69
eslint: Use cwd from executable location to fix nested projects (#3222)
* Split FindNearestExecutable from FindExecutable

The path searching in ale#node#FindExecutable() will be useful for
eslint.  Refactor it into a separate function so it can be used without
regard for the state of the _use_global and _executable variables.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* eslint: Set project root from local executable

Using the nearest directory with node_modules does not work correctly
for nested projects where the eslint dependencies are in the outer
project.  For example:
https://github.com/dense-analysis/ale/issues/3143#issuecomment-652452362

Adopt the behavior of SublimeLinter, which runs from project_root
determined by the presence of the eslint executable in node_modules/.bin
(or eslint in dependencies/devDependencies of package.json, which we can
add later as necessary).  See [NodeLinter#find_local_executable].

[NodeLinter#find_local_executable]: https://github.com/SublimeLinter/SublimeLinter/blob/056e6f6/lint/base_linter/node_linter.py#L109

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-07-08 14:49:29 +01:00
..
completion Close #1162 - Implement completion support with LSP servers 2018-04-22 12:28:19 +01:00
engine Add g:ale_disable_lsp and b:ale_disable_lsp to disable linters powered by LSP 2019-03-30 15:29:17 +09:00
fix add nimpretty fixer 2019-11-09 16:28:49 +07:00
fixers Run ESLint fixer from project root, where possible (#3096) 2020-07-01 17:53:33 +01:00
gradle Kotlin and general Gradle support. (#745) 2017-07-10 23:03:36 +01:00
handlers eslint: Use cwd from executable location to fix nested projects (#3222) 2020-07-08 14:49:29 +01:00
lsp Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709) 2019-09-12 21:53:23 +01:00
ant.vim misc: change email address for @ndrewtl 2020-01-28 10:47:37 -08:00
args.vim Add a function for parsing command args 2019-02-07 18:10:34 +00:00
assert.vim Fix the test issues with html-beautify 2019-10-28 13:45:25 +00:00
balloon.vim Get tests to pass in Vim 8.1 2018-07-23 20:41:48 +01:00
c.vim `arguments` needs to be handled for `compile_commands.json` in addition to `command` (#2123) 2019-09-19 20:20:37 +01:00
code_action.vim Rename ale#fix#SetBufferContents to ale#util#SetBufferContents 2019-10-22 16:39:43 -05:00
command.vim #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
completion.vim Merge pull request #2823 from jeremija/do-not-save-on-autoimport 2020-04-17 17:32:36 +01:00
cursor.vim #2417 - Silence errors for shortmess+=T 2019-04-08 11:41:23 +01:00
d.vim Remove otherproject#util#Double from d.vim 2019-04-13 07:59:01 +02:00
debugging.vim Add g:ale_sign_highlight_linenr (#2678) 2019-09-01 14:03:54 +01:00
definition.vim Closes #3019 - Implement default navigation 2020-04-15 16:50:13 +01:00
engine.vim Close #829 - Close LSP documents when buffers are deleted 2019-05-14 00:21:58 +01:00
events.vim Lint on InsertLeave, not in insert mode by default 2019-06-10 20:54:38 +01:00
filetypes.vim Update syntax checking 2019-02-06 18:05:13 +00:00
fix.vim Add old check for bufline api 2019-12-29 15:08:22 +01:00
go.vim Support $GO111MODULE with Go tooling 2019-07-01 11:04:33 -04:00
gradle.vim Get more of the tests to pass on Windows 2017-10-23 01:26:31 +01:00
highlight.vim Fixes #2982 - Implement g:ale_exclude_highlights 2020-03-11 12:52:41 -04:00
history.vim #1524 - Define global variables where they are needed 2018-05-28 19:19:20 +01:00
hover.vim Add option to show hover messages in preview. 2019-10-12 16:45:12 +07:00
java.vim Feature/add ant support (#2539) 2019-06-03 20:30:18 +01:00
job.vim Fix #2295 - Respond to initialize with an initialized message 2019-02-15 08:54:53 +00:00
julia.vim Fix other warnings 2018-09-08 16:05:34 -04:00
linter.vim Close #2764 - Support the new React filetypes with aliases 2019-09-19 20:48:37 +01:00
list.vim Keep cursor position on screen when opening/closing lists (#2632) 2019-08-17 19:14:21 +01:00
loclist_jumping.vim Fix #1317 - Jump to column 1 for problems at column 0 2019-05-17 22:08:03 +01:00
lsp.vim Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709) 2019-09-12 21:53:23 +01:00
lsp_linter.vim Adding support for LSP `window/showMessage` method (#2652) 2019-10-18 16:17:54 +01:00
lsp_window.vim Mention the disabled option for message severity 2019-10-18 16:22:17 +01:00
node.vim eslint: Use cwd from executable location to fix nested projects (#3222) 2020-07-08 14:49:29 +01:00
organize_imports.vim Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
other_source.vim #2017 Add support for display results from other sources 2018-10-29 18:28:28 +00:00
path.vim doc: Fix typos 2019-08-28 00:28:58 +08:00
pattern_options.vim Fix #1619 - Rewrite lint on enter events so they behave better 2018-07-17 00:18:34 +01:00
powershell.vim Linter for powershell syntax errors (#2413) 2019-04-13 12:24:56 +01:00
preview.vim Closes #3019 - Implement default navigation 2020-04-15 16:50:13 +01:00
python.vim Change Python project root dir detection for flake8 configuration 2019-05-19 09:51:26 -04:00
references.vim Closes #3019 - Implement default navigation 2020-04-15 16:50:13 +01:00
rename.vim Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
ruby.vim Move ale#handlers#ruby#EscapeExecutable to ale#ruby#EscapeExecutable 2019-08-13 01:52:13 -04:00
semver.vim #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
sign.vim Fix vim sign priority patch check 2020-03-15 14:58:38 +08:00
socket.vim Fix #1800 - Enable non-blocking writes where available 2018-09-06 20:04:35 +01:00
statusline.vim Update syntax checking 2019-02-06 18:05:13 +00:00
swift.vim [lsp] Add Swift / SourceKit-LSP support (#2420) 2019-04-08 16:25:30 +01:00
symbol.vim #2132 Use an on-init callback for all LSP logic 2019-02-13 17:26:37 +00:00
test.vim #2132 - lint and fix with ale#command#Run 2019-02-06 22:00:11 +00:00
toggle.vim Clear the virtualtext on disable 2019-02-20 11:08:27 +09:00
uri.vim #517 Add more code LSP support which makes the tssserver linter behave more like the LSP linters 2017-07-26 10:37:37 +01:00
util.vim Merge pull request #2823 from jeremija/do-not-save-on-autoimport 2020-04-17 17:32:36 +01:00
virtualtext.vim fix 2434: use text field instead of the detail field for virtualtext (#2441) 2019-04-16 14:40:39 +01:00