dense-analysis / dense-analysis/ale

jsonlint won't lint indentation when integrated with ALE

Open
#3,188 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

**VIM version**

```
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 26 2020 11:23:21)
Included patches: 1-510
```

Operating System:
```
$ uname -a
Linux Machine 5.6.11-arch1-1 #1 SMP PREEMPT Wed, 06 May 2020 17:32:37 +0000 x86_64 GNU/Linux

$ cat /etc/*lease
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux
```

## What went wrong

Running jsonlint directly in a .json file will indent it correctly. But when I open with vi, that has ALE installed, it will not show indentation as "issues" on the lines. But I know linting is working because it shows errors for other issues, like lack of commas, etc

## Reproducing the bug

I opened a .json file that is fully corrected. Then I mess up the indentation and nothing showed on the screen. But when I removed a comma, the red "X" on the left column (linting) shows up.
I looked for some .jsonlintrc file, but couldn't find anything like that.

### Relevant .vimrc
let g:ale_open_list = 1
let g:ale_list_window_size = 5
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 1
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
let g:ale_fixers = {
\ 'javascript': ['eslint', 'prettier'],
\ 'css': ['stylelint', 'prettier'],
\ 'json': ['prettier']
\}

### :ALEInfo

Current Filetype: json
Available Linters: ['jsonlint']
Enabled Linters: ['jsonlint']
Suggested Fixers:
'fixjson' - Fix JSON files with fixjson.
'jq' - Fix JSON files with jq.
'prettier' - Apply prettier to a file.
'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:

let g:ale_json_jsonlint_executable = 'jsonlint'
let g:ale_json_jsonlint_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_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
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 = {'json': ['prettier'], 'javascript': ['eslint', 'prettier'], 'css': ['stylelint', 'prettier']}
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 = 1
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 5
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
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_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 = 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_global_executables = v:null
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) /home/user/Documents/test-js3/node_modules/jsonlint/lib/cli.js
(finished - exit code 1) ['/bin/bash', '-c', '''/home/user/Documents/test-js3/node_modules/jsonlint/lib/cli.js'' --compact -
< ''/tmp/vSBte1c/1/es.json''']
<<>>
line 14, col 3, found: 'STRING' - expected: 'EOF', '}', ',', ']'.
<<>>
(finished - exit code 1) ['/bin/bash', '-c', '''/home/user/Documents/test-js3/node_modules/jsonlint/lib/cli.js'' --compact -
< ''/tmp/vSBte1c/2/es.json''']
<<>>
line 14, col 3, found: 'STRING' - expected: 'EOF', '}', ',', ']'.
<<>>

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the supplied Vim and ALE settings, then compare direct jsonlint behavior with the command recorded in :ALEInfo and the command history. Done means ALE reports the relevant JSON indentation problem while continuing to report syntax errors such as missing commas.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.