You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that ALE isn't respected the linter options when linting via the run_on_save hook. I have an .eslintrc file that disallows debugger statements. However, I have set g:ale_javascript_eslint_options = "--rule 'no-debugger: 0'" which should disable the check. It definitely works, and a debugger statement doesn't generate an error in my vim gutter. However, whenever I save the file, it just removes the statement, presumably to auto fixing that isn't respecting my set eslint options.
Reproducing the bug
Create an .eslintrc or config with no-debugger: "error".
Turn off g:ale_fix_on_save
Open a file, add a debugger and save. Note there is no error sign in the gutter.
Close the file and go turn on g:ale_fix_on_save
Open the file again. Still note that there is no error sign.
Save the file and watch the debugger disappear.
:ALEInfo
Current Filetype: javascript.jsx
Available Linters: ['eslint', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo']
Enabled Linters: ['eslint']
Suggested Fixers:
'eslint' - Apply eslint --fix 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 files using xo --fix.
Linter Variables:
let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_options = '--rule "no-debugger: 0"'
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
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 = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
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 = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'javascript': ['eslint']}
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_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['prettier', 'eslint']}
let g:ale_linters_explicit = 0
let g:ale_list_window_size = 10
let g:ale_list_vertical = 0
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 = {'\.min\.css$': {'ale_linters': [], 'ale_fixers': []}, '\.min\.js$': {'ale_linters': [], 'ale_fixers': []}}
let g:ale_pattern_options_enabled = v:null
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_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) /home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js
(started) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --rule "no-debugger: 0" -f unix --stdin --stdin-filename ''/home/james/Dev/Resource/resource-worktree/teammates/api/src/resolvers/customer/actions.js'' < ''/tmp/nvimwNQxVX/4/actions.js''']
(finished - exit code 0) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --rule "no-debugger: 0" -f unix --stdin --stdin-filename ''/home/james/Dev/Resource/resource-worktree/teammates/api/src/resolvers/customer/actions.js'' < ''/tmp/nvimwNQxVX/5/actions.js''']
<<<NO OUTPUT RETURNED>>>
(finished - exit code 0) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --version']
(finished - exit code 0) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --stdin-filename ''/home/james/Dev/Resource/resource-worktree/teammates/api/src/resolvers/customer/actions.js'' --stdin --fix-dry-run --format=json < ''/tmp/nvimwNQxVX/6/actions.js''']
(finished - exit code 0) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --rule "no-debugger: 0" -f unix --stdin --stdin-filename ''/home/james/Dev/Resource/resource-worktree/teammates/api/src/resolvers/customer/actions.js'' < ''/tmp/nvimwNQxVX/7/actions.js''']
<<<NO OUTPUT RETURNED>>>
(finished - exit code 0) ['/bin/bash', '-c', '''/home/james/Dev/Resource/resource-worktree/teammates/node_modules/eslint/bin/eslint.js'' --rule "no-debugger: 0" -f unix --stdin --stdin-filename ''/home/james/Dev/Resource/resource-worktree/teammates/api/src/resolvers/customer/actions.js'' < ''/tmp/nvimwNQxVX/8/actions.js''']
<<<NO OUTPUT RETURNED>>>
The text was updated successfully, but these errors were encountered:
w0rp
changed the title
Fix on Save Not Respecting Linter Options
The ESLint fixer doesn't use linter options
Oct 11, 2018
ESLint options are now used for fixers too. ALE will detect the use of -c or --config in the options and use that instead of searching for the configuration file for old versions, or just let ESLint figure it out for newer versions, which nearly everyone should be using now. Whatever option you set for the config will override that.
Information
VIM version
NVIM v0.3.1
Build type: Release
Operating System: Arch Linux 4.18.10-arch1-1-ARCH
What went wrong
It seems that ALE isn't respected the linter options when linting via the
run_on_save
hook. I have an .eslintrc file that disallowsdebugger
statements. However, I have setg:ale_javascript_eslint_options = "--rule 'no-debugger: 0'"
which should disable the check. It definitely works, and a debugger statement doesn't generate an error in my vim gutter. However, whenever I save the file, it just removes the statement, presumably to auto fixing that isn't respecting my set eslint options.Reproducing the bug
no-debugger: "error"
.g:ale_fix_on_save
debugger
and save. Note there is no error sign in the gutter.g:ale_fix_on_save
debugger
disappear.:ALEInfo
The text was updated successfully, but these errors were encountered: