ale/test
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
..
.config/nvim
ada_files Add gnatpp fixer for Ada 2019-07-01 20:50:02 -04:00
ant-test-files Feature/add ant support (#2539) 2019-06-03 20:30:18 +01:00
command_callback Support revive for go files (#2933) 2020-05-22 06:09:14 -05:00
compile_database_perf
completion Merge pull request #2823 from jeremija/do-not-save-on-autoimport 2020-04-17 17:32:36 +01:00
csslint-test-files
cucumber_fixtures/features
d_files dfmt support (#2662) 2019-09-10 20:54:14 +01:00
dart_files
elixir-test-files
elm-test-files
eslint-test-files eslint: Use cwd from executable location to fix nested projects (#3222) 2020-07-08 14:49:29 +01:00
fix Fix #2744 - Make ALEFix work when only casing is changed 2019-09-20 19:02:21 +01:00
fixers Run ESLint fixer from project root, where possible (#3096) 2020-07-01 17:53:33 +01:00
flow
go_files
gradle-test-files
hamllint-test-files
handler Fix handler test, function name has changed 2020-04-28 18:13:34 +01:00
javascript_files
json_files
jsonlint-test-files
kotlin_files
lsp Adding support for LSP window/showMessage method (#2652) 2019-10-18 16:17:54 +01:00
markdown_files
maven-test-files/maven-kotlin-project
nim-test-files/with-git/src Add support for nimlsp (#2815) 2019-10-17 17:32:31 +01:00
ocaml-test-files
phpcs-test-files
prettier-test-files
puppet-test-files
python Add TypeScript autoimport support for deoplete (#2779) 2020-01-01 19:00:41 +00:00
python_fixtures/pipenv
python-test-files/python-package-project Test for Python project root directory 2019-05-19 09:51:26 -04:00
reasonml_files
ruby_fixtures
rust_files
scala_fixtures
script Merge pull request #2696 from elebow/update-test-docs-for-linter-lists 2019-09-12 22:57:44 +01:00
sign Fix vim sign priority patch check 2020-03-15 14:58:38 +08:00
slimlint-test-files
smlnj
swift-test-files [lsp] Add Swift / SourceKit-LSP support (#2420) 2019-04-08 16:25:30 +01:00
swiftlint-test-files
terraform_files Add terraform-lsp integration (#2758) 2020-04-20 16:02:31 +01:00
test_c_projects Fix #2421 - Use compile_commands.json in build dirs to find roots 2019-05-20 19:57:08 +01:00
tex_files Add support for latexindent (#2387) 2019-04-13 13:21:59 +01:00
tflint-test-files/foo
top
util
dumb_tcp_client.py
dumb_tcp_server.py
smoke_test.vader
test_ale_has.vader Update the internal ALE version to 2.7.0 2020-06-11 19:21:17 +01:00
test_ale_info_to_clipboard.vader Fix #2438 - Print a friendly message when the clipboard is not available 2019-05-28 20:27:10 +01:00
test_ale_info.vader Add g:ale_sign_highlight_linenr (#2678) 2019-09-01 14:03:54 +01:00
test_ale_lint_command.vader
test_ale_toggle.vader 569 support vim sign group and priority (#2786) 2019-09-25 09:15:16 +01:00
test_ale_var.vader
test_alejobstarted_autocmd.vader
test_alelint_autocmd.vader
test_ant_build_classpath_command.vader Feature/add ant support (#2539) 2019-06-03 20:30:18 +01:00
test_ant_find_project_root.vader Feature/add ant support (#2539) 2019-06-03 20:30:18 +01:00
test_autocmd_commands.vader Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709) 2019-09-12 21:53:23 +01:00
test_backwards_compatibility.vader Use a function to define shellcheck linters and vars needed, fixes tests 2020-05-08 12:55:54 +01:00
test_balloon_messages.vader
test_c_flag_parsing.vader Fix cflags parsing (#2510, #2265) (#2590) 2019-08-17 19:08:14 +01:00
test_checkingbuffer_autocmd.vader
test_cleanup.vader
test_code_action.vader Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
test_command_chain.vader
test_csslint_config_detection.vader
test_cursor_warnings.vader Fix the cursor tests, that stop tests running 2020-04-18 12:26:38 +01:00
test_deferred_command_string.vader #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
test_deferred_executable_string.vader
test_disabling_ale.vader
test_dockerfile_hadolint_linter.vader
test_engine_invocation.vader
test_env_function.vader
test_errors_removed_after_filetype_changed.vader
test_eslint_executable_detection.vader eslint: Use cwd from executable location to fix nested projects (#3222) 2020-07-08 14:49:29 +01:00
test_filetype_linter_defaults.vader Close #2764 - Support the new React filetypes with aliases 2019-09-19 20:48:37 +01:00
test_filetype_mapping.vader
test_find_nearest_directory.vader
test_find_references.vader Closes #3019 - Implement default navigation 2020-04-15 16:50:13 +01:00
test_flow_command.vader #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
test_format_command.vader
test_format_temporary_file_creation.vader
test_function_arg_count.vader
test_fuzzy_json_decode.vader
test_get_abspath.vader
test_get_loclist.vader
test_getmatches.vader
test_go_to_definition.vader Closes #3019 - Implement default navigation 2020-04-15 16:50:13 +01:00
test_gradle_build_classpath_command.vader
test_gradle_find_executable.vader
test_gradle_find_project_root.vader
test_highlight_placement.vader Fixes #2982 - Implement g:ale_exclude_highlights 2020-03-11 12:52:41 -04:00
test_highlight_position_chunking.vader
test_history_saving.vader Fix LSP tests 2019-05-24 01:13:52 +01:00
test_hover.vader
test_ignoring_linters.vader Use JSON output for eslint and fix tsserver column 2019-06-02 14:39:03 +02:00
test_jsonlint_executable_detection.vader #2132 - Implement feature tests with ale#Has 2019-04-07 15:34:39 +01:00
test_kotlin_languageserver_path_detection.vader
test_line_join.vader
test_lint_file_linters.vader
test_lint_on_enter_when_file_changed.vader
test_lint_on_filetype_changed.vader
test_linter_defintion_processing.vader
test_linter_retrieval.vader Fix #1727 - Replace previoulsy defined linters with matching names 2019-06-10 22:41:20 +01:00
test_linter_type_mapping.vader
test_linting_blacklist.vader
test_linting_updates_loclist.vader
test_list_formatting.vader
test_list_opening.vader
test_list_titles.vader
test_load_all_linters.vader
test_loclist_binary_search.vader
test_loclist_corrections.vader
test_loclist_jumping.vader Fix #1317 - Jump to column 1 for problems at column 0 2019-05-17 22:08:03 +01:00
test_loclist_sorting.vader
test_nearest_file_search.vader
test_nimlsp_project_root.vader Add support for nimlsp (#2815) 2019-10-17 17:32:31 +01:00
test_no_linting_on_write_quit.vader Fix #2497 - ALE should not lint on save when disabled after fixing 2019-05-13 13:44:29 +01:00
test_organize_imports.vader Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
test_other_sources.vader
test_parse_command_args.vader
test_path_dirname.vader
test_path_equality.vader Fix #2525 - Convert Windows paths in a Unix environment 2019-06-05 14:16:43 +01:00
test_path_upwards.vader
test_path_uri.vader
test_pattern_options.vader
test_prepare_command.vader
test_puppet_path_detection.vader
test_python_find_project_root.vader Test for Python project root directory 2019-05-19 09:51:26 -04:00
test_python_pipenv.vader
test_python_traceback.vader
test_python_virtualenv.vader
test_quickfix_deduplication.vader
test_quitting_variable.vader
test_redundant_tsserver_rendering_avoided.vader #2403 - Make ale_disable_lsp apply consistently, and document it better 2019-05-10 13:42:41 +01:00
test_regex_escaping.vader
test_rename.vader Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
test_resolve_local_path.vader
test_results_not_cleared_when_opening_loclist.vader 569 support vim sign group and priority (#2786) 2019-09-25 09:15:16 +01:00
test_sandbox_execution.vader
test_semver_utils.vader #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
test_set_list_timers.vader
test_setting_loclist_from_another_buffer.vader
test_setting_problems_found_in_previous_buffers.vader 569 support vim sign group and priority (#2786) 2019-09-25 09:15:16 +01:00
test_shell_detection.vader Fix shell detection test, shellcheck function name has changed 2020-04-28 18:20:10 +01:00
test_should_do_nothing_conditions.vader Fix #2399 - Do not check buffers used for displaying diffs 2019-04-08 13:42:09 +01:00
test_sml_command.vader
test_socket_connections.vader
test_statusline.vader
test_swift_find_project_root.vader [lsp] Add Swift / SourceKit-LSP support (#2420) 2019-04-08 16:25:30 +01:00
test_swiftlint_executable_detection.vader #2132 - Implement feature tests with ale#Has 2019-04-07 15:34:39 +01:00
test_symbol_search.vader
test_temporary_file_management.vader
test_tmpdir_wrapper.vader
test_verilog_verilator_options.vader
test_vim8_processid_parsing.vader
test_windows_escaping.vader
test_wrap_comand.vader
test_writefile_function.vader Make a test fail less 2019-05-20 19:27:47 +01:00
vimrc Fix #2555 - Remove highlights in lowercase, etc 2019-06-03 20:16:49 +01:00