Skip to content

Commit 1639356

Browse files
committed
fix: Prefer the native JSON parser, if possible, to improve performance
1 parent 1fe98ef commit 1639356

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ function parse (source, file) {
7272
try {
7373
parsed = parser.parse(source, {
7474
ignoreComments: options.comments,
75-
allowSingleQuotedStrings: options.singleQuotedStrings
75+
allowSingleQuotedStrings: options.singleQuotedStrings,
76+
limitedErrorInfo: !(options.comments || options.singleQuotedStrings)
7677
})
7778
if (options.sortKeys) {
7879
parsed = sorter.sortObject(parsed)

0 commit comments

Comments
 (0)