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
No linting TypeScript files on filenames with brackets #3183
Comments
I don't have
And it linted just fine. Same with Perhaps it has something to do with |
Noted. Thanks for checking. I was able to bypass the problem by adding this: autoload/ale/ale_linter.vim (line 53)
It seems function |
For those looking for the file it can be found here: ale/autoload/ale/lsp_linter.vim Line 53 in 5eda1df
And to highlight the changes @thisjeremiah made: function! s:HandleTSServerDiagnostics(response, error_type) abort
let l:linter_name = 'tsserver'
let l:buffer = bufnr('^' . a:response.body.file . '$')
+ if l:buffer == -1
+ let l:buffer = 1
+ endif Many ALE users are likely to encounter this issue as bracket filenames are how the popular framework Next.js handles dynamic routing. |
I've pushed a fix for this now. I can't work out how to escape |
* master: (123 commits) Add tests for maven.vim file Fix grammatical error in doc Add maven helper file; use maven wrapper if available instead of global 'mvn' executable fix lint, fix variable semantics and update tests bibclean: update matchlist reges for bibclean > v2.11.4 Bump the ALE version to 3.0.0 Close dense-analysis#2522 - Check pylint on the fly Add tests for covering the coming Vint version Close dense-analysis#3003 - Show ignored linters in :ALEInfo Close dense-analysis#3333 - Add an ALECompletePost event Fix a completion error Fix typo Close dense-analysis#3268 - Implement :ALEImport Fix dense-analysis#3183 - Escape filename characters from LSP/tsserver Clean up embertemplatelint code Fix asciidoc languagetool integration Fix dense-analysis#3322 - Apply rename changes correctly feat(template-lint): Read from stdin (dense-analysis#2622) Fix flake8 cd logic for invalid options Add tests for \r removal ...
Information
VIM version
NVIM v0.5.0-nightly
Build type: Release
LuaJIT 2.0.5
Operating System:
macOS Catalina
10.15.4 (19E287)
What went wrong
Linting does not work for files with square brackets in the name.
This is a problem with some other linting projects:
stylelint/stylelint#4515
lint-staged/lint-staged#676
Reproducing the bug
script.tsx
.[script].tsx
.:ALEInfo
Current Filetype: typescriptreact
Available Linters: ['eslint', 'standard', 'tslint', 'tsserver', 'typecheck', 'xo']
Enabled Linters: ['tsserver']
Suggested Fixers:
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
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_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 = {'typescript': ['prettier'], 'json': ['prettier'], 'typescriptreact': ['prettier'], 'javascriptreact': ['prettier'], 'graphql': ['prettier'], 'prisma': ['prettier'], 'javascript': ['prettier'], 'css': ['prettier'], 'python': ['black']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 100
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 = {'cs': ['OmniSharp'], 'javascript': ['tsserver'], 'javascriptreact': ['tsserver'], 'typescriptreact': ['tsserver'], 'json': ['jsonlint'], 'typescript': ['tsserver'], 'python': ['mypy']}
let g:ale_linters_explicit = 1
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 1
let g:ale_pattern_options = v:null
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 = 2
let g:ale_set_signs = 1
let g:ale_sign_column_always = v:null
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_sign_highlight_linenrs = v:null
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = 1
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) tsserver
(started) ['/bin/zsh', '-c', '''tsserver''']
(finished - exit code 0) ['/bin/zsh', '-c', '''prettier'' --version']
<<>>
1.19.1
<<>>
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/jeremiahmontoya/Documents/x/repos/x.com/src/pages/post'' && ''prettier'' --stdin-filepath ''/Users/jeremiahmontoya/Documents/x/repos/x.com/src/pages/post/[slug].tsx'' --stdin < ''/var/folders/63/bmfw9dcd0n59c7jfmt75pq8m0000gp/T/nvimDv04h9/4/[slug].tsx''']
The text was updated successfully, but these errors were encountered: