Giter VIP home page Giter VIP logo

jsonlint's People

Contributors

codenothing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jsonlint's Issues

Invalid parsing of escaped unicode values

Currently using this library in a Grunt task, and ran into the following issue:

// JSON file data being linted
{
    "copyright": "\u2117 & \u00a9 2014 {{sitename}}"
}

// BASH error...
Invalid Reverse Solidus '\' declaration.

Just tested the above snippet against jsonlint.com, jsonlint pro, and jsoneditoronline and they all infer the unicode characters and parse as valid JSON data.

This snippet exists in a much deeper part of my JSON data that is compiled via PHP's json_encode function, however the raw escaped unicode values cause this linter to throw the above error.

Escaping the reverse solidus ["\\u2117 & \\u00a9 2014 {{sitename}}"] "fixes" the issue; though it seems inconvenient as most systems escape unicode values in this fashion by default.

Embedded line breaks in JSON strings

jsonlint doesn't seem to catch illegal embedded line breaks in JSON strings:

{
  "foo": "bar
bar bar bar bar"
}

Looks like the error flag is never set and .line always references the last line of the file. The JSONLint validator does return the error (well, the line number anyway), as does zaach/jsonlint.

Finding duplicated keys

Hi,
It would be nice if the library could find the duplicated keys.
Example :

{
  "myKey": value,
  "myKey": value
   ^^^^ Error duplicated key
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.