File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ function parse (source) {
90
90
}
91
91
}
92
92
93
- return JSON . stringify ( parsed , null , options . indent ) ;
93
+ return JSON . stringify ( parsed , null , options . indent ) ;
94
94
} catch ( e ) {
95
- if ( options . forcePrettyPrint ) {
95
+ if ( options . forcePrettyPrint ) {
96
96
/* From https://github.com/umbrae/jsonlintdotcom:
97
97
* If we failed to validate, run our manual formatter and then re-validate so that we
98
98
* can get a better line number. On a successful validate, we don't want to run our
@@ -107,16 +107,15 @@ function parse (source) {
107
107
if ( ! options . compact ) {
108
108
console . error ( e ) ;
109
109
}
110
- return formatted ;
111
- process . exit ( 1 ) ;
110
+ // force the pretty print before exiting
111
+ console . log ( formatted ) ;
112
112
}
113
113
} else {
114
114
if ( ! options . compact ) {
115
115
console . error ( e ) ;
116
116
}
117
-
118
- process . exit ( 1 ) ;
119
117
}
118
+ process . exit ( 1 ) ;
120
119
}
121
120
}
122
121
You can’t perform that action at this time.
0 commit comments