aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/doc/ale-json.txt
blob: 1f72f8329ca733997b7ce2994b3f3591674916fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
===============================================================================
ALE JSON Integration                                         *ale-json-options*


===============================================================================
biome                                                          *ale-json-biome*

Check the docs over at |ale-typescript-biome|.


===============================================================================
clang-format                                             *ale-json-clangformat*

See |ale-c-clangformat| for information about the available options.
Note that the C options are also used for JSON.


===============================================================================
cspell                                                        *ale-json-cspell*

See |ale-cspell-options|


===============================================================================
dprint                                                        *ale-json-dprint*

See |ale-dprint-options| and https://dprint.dev/plugins/json


===============================================================================
eslint                                                        *ale-json-eslint*

The `eslint` linter for JSON uses the JavaScript options for `eslint`; see:
|ale-javascript-eslint|.

You will need a JSON ESLint plugin installed for this to work.


===============================================================================
fixjson                                                      *ale-json-fixjson*

fixjson is a JSON file fixer/formatter for humans using (relaxed) JSON5.
It provides:

- Pretty-prints JSON input
- Fixes various failures while humans writing JSON
  - Fixes trailing commas objects or arrays
  - Fixes missing commas for elements of objects or arrays
  - Adds quotes to keys in objects
  - Newlines in strings
  - Hex numbers
  - Fixes single quotes to double quotes

You can install it using npm:
>
  $ npm install -g fixjson
<
ALE provides fixjson integration as a fixer. See |ale-fix|.

-------------------------------------------------------------------------------
Options
                                          *ale-options.json_fixjson_executable*
                                                *g:ale_json_fixjson_executable*
                                                *b:ale_json_fixjson_executable*
json_fixjson_executable
g:ale_json_fixjson_executable
  Type: |String|
  Default: `'fixjson'`

  The executable that will be run for fixjson.

                                             *ale-options.json_fixjson_options*
                                                   *g:ale_json_fixjson_options*
                                                   *b:ale_json_fixjson_options*
json_fixjson_options
g:ale_json_fixjson_options
  Type: |String|
  Default: `''`

  This variable can add extra options to the command executed for running
  fixjson.

                                          *ale-options.json_fixjson_use_global*
                                                *g:ale_json_fixjson_use_global*
                                                *b:ale_json_fixjson_use_global*
json_fixjson_use_global
g:ale_json_fixjson_use_global
  Type: |Number|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
pytool                                                        *ale-json-pytool*

Use python's json.tool module to reformat json.

                                           *ale-options.json_pytool_executable*
                                                 *g:ale_json_pytool_executable*
                                                 *b:ale_json_pytool_executable*
json_pytool_executable
g:ale_json_pytool_executable
  Type: |String|
  Default: `'python'`

  The python executable that run to use its json.tool module. This fixer
  requires python 3, which includes the json module.

                                              *ale-options.json_pytool_options*
                                                    *g:ale_json_pytool_options*
                                                    *b:ale_json_pytool_options*
json_pytool_options
g:ale_json_pytool_options
  Type: |String|
  Default: `''`

  These options are passed to the json.tool module. Example: >
    let g:ale_json_pytool_options = '--sort-keys --indent 2'
<  See docs for all options:
    https://docs.python.org/3/library/json.html#module-json.tool

                                           *ale-options.json_pytool_use_global*
                                                 *g:ale_json_pytool_use_global*
                                                 *b:ale_json_pytool_use_global*
json_pytool_use_global
g:ale_json_pytool_use_global
  Type: |Number|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
jsonlint                                                    *ale-json-jsonlint*

                                         *ale-options.json_jsonlint_executable*
                                               *g:ale_json_jsonlint_executable*
                                               *b:ale_json_jsonlint_executable*
json_jsonlint_executable
g:ale_json_jsonlint_executable
  Type: |String|
  Default: `'jsonlint'`

  The executable that will be run for jsonlint.

                                         *ale-options.json_jsonlint_use_global*
                                               *g:ale_json_jsonlint_use_global*
                                               *b:ale_json_jsonlint_use_global*
json_jsonlint_use_global
g:ale_json_jsonlint_use_global
  Type: |Number|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
jq                                                                *ale-json-jq*

                                               *ale-options.json_jq_executable*
                                                     *g:ale_json_jq_executable*
                                                     *b:ale_json_jq_executable*
json_jq_executable
g:ale_json_jq_executable
  Type: |String|
  Default: `'jq'`

  This option can be changed to change the path for `jq`.


                                                  *ale-options.json_jq_options*
                                                        *g:ale_json_jq_options*
                                                        *b:ale_json_jq_options*
json_jq_options
g:ale_json_jq_options
  Type: |String|
  Default: `''`

  This option can be changed to pass extra options to `jq`.

                                                  *ale-options.json_jq_filters*
                                                        *g:ale_json_jq_filters*
                                                        *b:ale_json_jq_filters*
json_jq_filters
g:ale_json_jq_filters
  Type: |String|
  Default: `'.'`

  This option can be changed to pass custom filters to `jq`.


===============================================================================
prettier                                                    *ale-json-prettier*

See |ale-javascript-prettier| for information about the available options.


===============================================================================
spectral                                                    *ale-json-spectral*

Website: https://github.com/stoplightio/spectral


-------------------------------------------------------------------------------
Installation

Install spectral either globally or locally: >

  npm install @stoplight/spectral -g  # global
  npm install @stoplight/spectral     # local
<

-------------------------------------------------------------------------------
Options

                                         *ale-options.json_spectral_executable*
                                               *g:ale_json_spectral_executable*
                                               *b:ale_json_spectral_executable*
json_spectral_executable
g:ale_json_spectral_executable
  Type: |String|
  Default: `'spectral'`

  This variable can be set to change the path to spectral.

                                         *ale-options.json_spectral_use_global*
                                               *g:ale_json_spectral_use_global*
                                               *b:ale_json_spectral_use_global*
json_spectral_use_global
g:ale_json_spectral_use_global
  Type: |String|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
vscodejson                                                    *ale-json-vscode*

Website: https://github.com/hrsh7th/vscode-langservers-extracted

-------------------------------------------------------------------------------
Installation

Install VSCode json language server either globally or locally: >

  npm install -g vscode-langservers-extracted
<

===============================================================================
  vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: