Support fixing JSON files with fixjson

This commit is contained in:
rhysd 2018-01-24 10:36:02 +00:00 committed by w0rp
parent d562d53102
commit b28a6ddbe4
7 changed files with 118 additions and 2 deletions

View file

@ -2,6 +2,45 @@
ALE JSON Integration *ale-json-options*
===============================================================================
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|.
g:ale_json_fixjson_executable *g:ale_json_fixjson_executable*
*b:ale_json_fixjson_executable*
Type: |String|
Default: `'fixjson'`
The executable that will be run for fixjson.
g:ale_json_fixjson_options *g:ale_json_fixjson_options*
*b:ale_json_fixjson_options*
Type: |String|
Default: `''`
This variable can add extra options to the command executed for running
fixjson.
===============================================================================
jsonlint *ale-json-jsonlint*

View file

@ -112,6 +112,7 @@ CONTENTS *ale-contents*
standard............................|ale-javascript-standard|
xo..................................|ale-javascript-xo|
json..................................|ale-json-options|
fixjson.............................|ale-json-fixjson|
jsonlint............................|ale-json-jsonlint|
jq..................................|ale-json-jq|
prettier............................|ale-json-prettier|
@ -322,7 +323,7 @@ Notes:
* Idris: `idris`
* Java: `checkstyle`, `javac`, `google-java-format`
* JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
* JSON: `jsonlint`, `jq`, `prettier`
* JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
* Kotlin: `kotlinc`, `ktlint`
* LaTeX (tex): `alex`!!, `chktex`, `lacheck`, `proselint`, `redpen`, `vale`, `write-good`
* Less: `lessc`, `prettier`, `stylelint`