Skip to content

Commit

Permalink
replace jsonlint with parse-json (#41)
Browse files Browse the repository at this point in the history
* replace jsonlint with parse-json

* fix parse-json version
  • Loading branch information
maccuaa authored May 24, 2021
1 parent 8f8e819 commit 13d5f18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
"indent-string": "^3.2.0",
"intl-messageformat-parser": "^5.4.0",
"jest-diff": "^22.0.3",
"jsonlint": "^1.6.2",
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"lodash.isplainobject": "^4.0.6",
"lodash.set": "^4.3.2",
"log-symbols": "^2.2.0",
"parse-json": "^5.2.0",
"plur": "^2.1.2",
"pretty-format": "^22.0.3"
}
Expand Down
4 changes: 2 additions & 2 deletions src/valid-json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const jsonlint = require('jsonlint');
const parseJson = require('parse-json');
const isPlainObject = require('lodash.isplainobject');
const chalk = require('chalk');
const requireNoCache = require('./util/require-no-cache');
Expand All @@ -15,7 +15,7 @@ const validJSON = ([{ linter } = {}], source) => {
// use custom linter
parsed = requireNoCache(linter)(source);
} else {
parsed = jsonlint.parse(source);
parsed = parseJson(source);
}

if (!isPlainObject(parsed)) {
Expand Down
4 changes: 2 additions & 2 deletions src/valid-json.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ruleTester.run('valid-json', rule, {
errors: [
{
message: /\nInvalid JSON\.\n\n.*/,
line: 2,
line: 0,
col: 0
}
]
Expand All @@ -83,7 +83,7 @@ ruleTester.run('valid-json', rule, {
errors: [
{
message: /\nInvalid JSON\.\n\n.*/,
line: 1,
line: 0,
col: 0
}
]
Expand Down

0 comments on commit 13d5f18

Please sign in to comment.