-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALE eslint cannot find config #4487
Comments
Hi @theahura - Thank you for the bug report. I was able to replicate the issue on my end. I think it is some incompatibility between eslint v8 and v9. According to eslint docs for v9 [1] (emphasis mine):
and...
Moving Edit: After digging further into eslint docs, I found this. So, in theory, it should detect So, I think this issue is with how working directory gets resolved in ale for js/ts projects:
In short, the |
@theahura - by any chance, have you read the docs about nested eslint configurations? I was able to resolve the issue on my end without ale code changes, by updating the eslint config file like: module.exports = {
// redacted for brevity
"extends": [
"../../eslint.config.js" // to extend the root eslint.config.js
],
// redacted for brevit
} |
I've read those docs before, but I don't follow what the suggestion is. Just to confirm, is the suggestion to have an eslint config at root AND an extension in each app folder?
?
Each package/eslint.config.js looks something like this (pulling an actual examples)
so we actually are inlining the full root eslint config here |
Just leaving a comment here because I have run into the exact same issue with a similar setup. If you have an idea how to fix this let me know your thoughts - perhaps I can have a go at implementing. |
Something like this perhaps #4637 |
The Vader tests are a rabbit whole I can't really figure out ATM (happy for any guidance). In the meantime I have added the following hack to
|
I'm having the same problem. PLEASE provide an escape hatch / option override for evaluating Please! Please! Please! |
For context, the reason the current current directory logic does not work for my specific monorepo is that our project uses Yarn workspaces. The system does not add monorepo wide executables to each workspace's @bodymindarts workaround does the job for my use case. It is unfortunate it needs such a sledge hammer approach though. |
I just discovered that even in a yarn workspace running from the top level will still process configs down the chain as it resolves them from the |
I seem to have run into this issue again, unexpectedly on a new machine. I have no idea how I fixed the old machine, whoops. @bodymindarts any chance of reviving that PR that you were working on earlier? I am getting a slightly different error now than the one i was getting when I first filed the report -- namely, |
Got it! I had a rogue .eslintrc file in my home directory, deleting that fixed it for me (both the original time and this time) |
Information
VIM version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 10 2022 08:40:37)
Included patches: 1-749
Operating System:
Ubuntu 20.04.3 LTS
What went wrong
Apologize if this is not the right place for this! Could be considered a configuration issue, not sure.
I switched from Syntastic to ALE recently and noticed that ALE was not able to find my organization's
eslint.config.js
file. The organization has a folder structure like so:Basically we have a monorepo with multiple apps and hoist shared dependencies (like eslint) to the top level, but individual apps can have their own lint configurations among other things.
ALE says it cannot find the config:
When I run ALEInfo, I see the following:
The reason I don't think this is an eslint bug is because I can run eslint just fine in my app package. For what its worth, Syntastic too did not have any issues. And yet, through ALE, eslint is unable to find any config. I also tried running that eslint command in my own bash terminal and it just hangs, not sure whats up with that. If I remove the
--stdin --stdin-filename
and just run eslint on the file in question, it works fine in bash, but again not in ALEWould appreciate any help!
:ALEInfo
Expand
Current Filetype: javascript Available Linters: ['cspell', 'deno', 'eslint', 'fecs', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo'] Enabled Linters: ['cspell', 'deno', 'eslint', 'fecs', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo'] Ignored Linters: [] Suggested Fixers: 'clang-format' - Fix C, C++, C#, CUDA, Java, JavaScript, JSON, ObjectiveC and Protobuf files with clang-format. 'dprint' - Pluggable and configurable code formatting platform 'eslint' - Apply eslint --fix to a file. 'fecs' - Apply fecs format to a file. 'importjs' - automatic imports for javascript 'prettier' - Apply prettier to a file. 'prettier_eslint', 'prettier-eslint' - Apply prettier-eslint to a file. 'prettier_standard', 'prettier-standard' - Apply prettier-standard to a file. 'remove_trailing_lines' - Remove all blank lines at the end of a file. 'standard' - Fix JavaScript files using standard --fix 'trim_whitespace' - Remove all trailing whitespace characters at the end of every line. 'xo' - Fix JavaScript/TypeScript files using xo --fix. Linter Variables:let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_options = ''
let g:ale_javascript_eslint_suppress_eslintignore = 0
let g:ale_javascript_eslint_suppress_missing_config = 0
let g:ale_javascript_eslint_use_global = 0
let g:ale_javascript_fecs_executable = 'fecs'
let g:ale_javascript_fecs_use_global = 0
let g:ale_javascript_flow_executable = 'flow'
let g:ale_javascript_flow_ls_executable = 'flow'
let g:ale_javascript_flow_ls_use_global = 0
let g:ale_javascript_flow_use_global = 0
let g:ale_javascript_flow_use_home_config = 0
let g:ale_javascript_flow_use_respect_pragma = 1
let g:ale_javascript_jscs_executable = 'jscs'
let g:ale_javascript_jscs_use_global = 0
let g:ale_javascript_jshint_executable = 'jshint'
let g:ale_javascript_jshint_use_global = 0
let g:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
let g:ale_javascript_tsserver_config_path = ''
let g:ale_javascript_tsserver_executable = 'tsserver'
let g:ale_javascript_tsserver_use_global = 0
let g:ale_javascript_xo_executable = 'xo'
let g:ale_javascript_xo_options = ''
let g:ale_javascript_xo_use_global = 0
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
LSP Error Messages:
(Errors for flow-language-server)
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Command History:
(executable check - failure) cspell
(executable check - failure) deno
(finished - exit code 2) ['/bin/bash', '-c', 'cd ''/home/soot/code/soot/hearth'' && ''/home/soot/code/soot/hearth/node_modules/eslint/bin/eslint.js'' -f json --stdin --stdin-filename ''/home/soot/code/soot/hearth/packages/ui/src/index.js'' < ''/tmp/vGyg5eP/4/index.js''']
<<>>
Oops! Something went wrong! :(
ESLint: 8.35.0
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
ESLint looked for configuration files in /home/soot/code/soot/hearth/packages/ui/src and its ancestors. If it found none, it then looked in your home directory.
If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat
<<>>
(executable check - failure) fecs
(executable check - failure) jscs
(executable check - failure) jshint
(executable check - failure) standard
(started) ['/bin/bash', '-c', '''/home/soot/code/soot/hearth/packages/ui/node_modules/.bin/tsserver''']
(executable check - failure) xo
(executable check - failure) deno
The text was updated successfully, but these errors were encountered: