Skip to content

Commit 13d5f18

Browse files
authored
replace jsonlint with parse-json (#41)
* replace jsonlint with parse-json * fix parse-json version
1 parent 8f8e819 commit 13d5f18

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060
"indent-string": "^3.2.0",
6161
"intl-messageformat-parser": "^5.4.0",
6262
"jest-diff": "^22.0.3",
63-
"jsonlint": "^1.6.2",
6463
"lodash.get": "^4.4.2",
6564
"lodash.isequal": "^4.5.0",
6665
"lodash.isplainobject": "^4.0.6",
6766
"lodash.set": "^4.3.2",
6867
"log-symbols": "^2.2.0",
68+
"parse-json": "^5.2.0",
6969
"plur": "^2.1.2",
7070
"pretty-format": "^22.0.3"
7171
}

src/valid-json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const jsonlint = require('jsonlint');
1+
const parseJson = require('parse-json');
22
const isPlainObject = require('lodash.isplainobject');
33
const chalk = require('chalk');
44
const requireNoCache = require('./util/require-no-cache');
@@ -15,7 +15,7 @@ const validJSON = ([{ linter } = {}], source) => {
1515
// use custom linter
1616
parsed = requireNoCache(linter)(source);
1717
} else {
18-
parsed = jsonlint.parse(source);
18+
parsed = parseJson(source);
1919
}
2020

2121
if (!isPlainObject(parsed)) {

src/valid-json.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ruleTester.run('valid-json', rule, {
6969
errors: [
7070
{
7171
message: /\nInvalid JSON\.\n\n.*/,
72-
line: 2,
72+
line: 0,
7373
col: 0
7474
}
7575
]
@@ -83,7 +83,7 @@ ruleTester.run('valid-json', rule, {
8383
errors: [
8484
{
8585
message: /\nInvalid JSON\.\n\n.*/,
86-
line: 1,
86+
line: 0,
8787
col: 0
8888
}
8989
]

0 commit comments

Comments
 (0)