Reproduction: https://github.com/swantzter/jsonlint-repro
Hi, we're having an issue where there's inconsistent behaviours between --pretty-print and "just" linting when it comes to empty objects.
When pretty-print serialises an object it outputs {\n} whereas the lint want it to become just {}
Given the above reproduction and test.json:
{
"obj1": {},
"obj2": {
}
}
running npm run lint:fix (jsonlint --in-place --pretty-print) changes the file and outputs the following
{
"obj1": {
},
"obj2": {
}
}
Running npm run lint (jsonlint) after that makes it complain:
test.json: 1 hunk differs
===================================================================
--- test.json.orig
+++ test.json
@@ -1,6 +1,4 @@
{
- "obj1": {
- },
- "obj2": {
- }
+ "obj1": {},
+ "obj2": {}
}
Reproduction: https://github.com/swantzter/jsonlint-repro
Hi, we're having an issue where there's inconsistent behaviours between
--pretty-printand "just" linting when it comes to empty objects.When pretty-print serialises an object it outputs
{\n}whereas the lint want it to become just{}Given the above reproduction and test.json:
{ "obj1": {}, "obj2": { } }running
npm run lint:fix(jsonlint --in-place --pretty-print) changes the file and outputs the following{ "obj1": { }, "obj2": { } }Running
npm run lint(jsonlint) after that makes it complain: