Skip to content

Update: Replace deprecated json-lint with json-parse-even-better-errors (fixes #203)#228

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/remove-json-lint-dependency
Open

Update: Replace deprecated json-lint with json-parse-even-better-errors (fixes #203)#228
Copilot wants to merge 5 commits intomasterfrom
copilot/remove-json-lint-dependency

Conversation

Copy link

Copilot AI commented Feb 17, 2026

Fixes #203

Update

  • Replaced json-lint (unmaintained since 2012) with json-parse-even-better-errors in JSONReadValidate.js
  • Refactored error message formatting to extract error description without duplicating line/column information already present in the source error

Details

Before:

import JSONLint from 'json-lint'

const lint = JSONLint(jsonData)
if (!lint.error) return
// Error: "JSON parsing error: Unknown Character '}', ..., line: 1, character: 18, ..."

After:

import parseJson from 'json-parse-even-better-errors'

try {
  parseJson(jsonData)
} catch (err) {
  // Error: "JSON parsing error: Expected double-quoted property name in JSON, line: 1, character: 18, ..."
}

Error messages remain backward compatible while leveraging actively maintained library with better error reporting.

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove deprecated json-lint dependency</issue_title>
<issue_description>### Subject of the issue/enhancement/features
We have a deprecated dependency in json-lint (no version bumps for 12 years). As far as I can see, it's only used for the logging of JSON errors in lib/util/JSONReadValidate.js.

Can we get this dependency removed/replaced with something better supported? (happy to do the work if I understand what's needed).


Potential replacement: https://github.com/npm/json-parse-even-better-errors</issue_description>

Comments on the Issue (you are @copilot in this section)

@oliverfoster https://github.com/npm/json-parse-even-better-errors ?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 17, 2026 13:55
Co-authored-by: taylortom <1059083+taylortom@users.noreply.github.com>
Co-authored-by: taylortom <1059083+taylortom@users.noreply.github.com>
Co-authored-by: taylortom <1059083+taylortom@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove deprecated json-lint dependency Update: Replace deprecated json-lint with json-parse-even-better-errors Feb 17, 2026
Copilot AI requested a review from taylortom February 17, 2026 14:02
@taylortom taylortom marked this pull request as ready for review February 17, 2026 15:01
…ven-better-errors

The library already produces clear, human-readable messages with position,
line/column, and a context snippet showing surrounding text. The regex
reformatting was losing the useful "near ..." context and was fragile
against future message format changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@taylortom taylortom changed the title Update: Replace deprecated json-lint with json-parse-even-better-errors Update: Replace deprecated json-lint with json-parse-even-better-errors (fixes #203) Feb 17, 2026
Copy link
Contributor

@swashbuck swashbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Remove deprecated json-lint dependency

4 participants

Comments