codenothing / jsonlint Goto Github PK
View Code? Open in Web Editor NEWJSON Linter that allows comments
Home Page: http://codenothing.github.com/jsonlint/
License: MIT License
JSON Linter that allows comments
Home Page: http://codenothing.github.com/jsonlint/
License: MIT License
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.
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.
const lint = JSONLint('}', {comments: false})
Populates lint.error with:
Unknown character '}', expecting opening block '{' or '[', or maybe a comment
As comments are disabled the 'or maybe a comment' is incorrect
Hi,
It would be nice if the library could find the duplicated keys.
Example :
{
"myKey": value,
"myKey": value
^^^^ Error duplicated key
}
https://travis-ci.org/codenothing/jsonlint/builds/212914382
The eval npm install
phase of the tests is returning an error. I don't know enough about npm and travis to know how to fix it though.
Using atom-linter-json-lint
I got this error:
This error message is very confusing.
{
"bitwise": true,
"";
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.