# profile-builder/3.9.8/assets/lib/codemirror/addon/lint/json-lint.js

User Profile Builder – Beautiful User Registration Forms, User Profiles &amp; User Role Editor, version 3.9.8. 16 lines.

- Page: https://pluginprobe.com/plugins/profile-builder/3.9.8/code/assets/lib/codemirror/addon/lint/json-lint.js
- Raw: https://pluginprobe.com/plugins/profile-builder/3.9.8/raw/assets/lib/codemirror/addon/lint/json-lint.js
- Modified: 2022-10-05T06:23:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/profile-builder/3.9.8/code/assets/lib/codemirror/addon/lint/json-lint.js#L10-L20`.

```javascript
// Depends on jsonlint.js from https://github.com/zaach/jsonlint

CodeMirror.registerHelper("lint", "json", function(text) {
  var found = [];
  jsonlint.parseError = function(str, hash) {
    var loc = hash.loc;
    found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
                to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
                message: str});
  };
  try { jsonlint.parse(text); }
  catch(e) {}
  return found;
});
CodeMirror.jsonValidator = CodeMirror.lint.json; // deprecated

```
