Giter Site home page Giter Site logo

Comments (6)

zoidbergwill avatar zoidbergwill commented on May 18, 2024

I guess this is a JSON issue, and not a jsonlint issue, but maybe we should switch to the npm-installable one:

± cat test.json
{
  "one": "value",
  "two": 2,
  "three": "three",
}
± jsonlint -c test.json
test.json: line 4, col 19, found: '}' - expected: 'STRING'.

from lint-review.

zoidbergwill avatar zoidbergwill commented on May 18, 2024

I can't see public access to the source for demjson or a public issue tracker either.

from lint-review.

adrianmoisey avatar adrianmoisey commented on May 18, 2024

Seems legit:

$ jsonlint -c has_errors.json
has_errors.json: line 1, col 0, found: 'INVALID' - expected: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['.
$ jsonlint -c has_warnings.json
has_warnings.json: line 2, col 8, found: 'INVALID' - expected: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['.
$ jsonlint -c no_errors.json
{
  "one": "value",
  "two": 2
}

from lint-review.

zoidbergwill avatar zoidbergwill commented on May 18, 2024

I take that back.

The errors are definitely not as pretty, and it doesn't have have warnings. The npm one hasn't been updated in two years.

± jsonlint -c -s tests/fixtures/jsonlint/has_warnings.json
tests/fixtures/jsonlint/has_warnings.json: line 2, col 8, found: 'INVALID' - expected: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['.

± virtualenv/bin/jsonlint tests/fixtures/jsonlint/has_warnings.json
tests/fixtures/jsonlint/has_warnings.json:2:9: Warning: String literals must use double quotation marks in strict JSON
   |  At line 2, column 9, offset 11
tests/fixtures/jsonlint/has_warnings.json:3:12: Warning: JSON does not allow identifiers to be used as strings: u'three'
   |  At line 3, column 12, offset 32
tests/fixtures/jsonlint/has_warnings.json:3:28: Warning: Strict JSON does not allow a final comma in an object (dictionary) literal
   |  At line 3, column 28, offset 48
   |  Object started at line 1, column 0, offset 0 (AT-START)
tests/fixtures/jsonlint/has_warnings.json: ok, with warnings

from lint-review.

zoidbergwill avatar zoidbergwill commented on May 18, 2024

Looking at how Yelp's pre-commit does checking if JSON is correct and compares it to pretty formatted JSON, maybe we should do this ourselves?

Though I guess as a standalone library?

from lint-review.

markstory avatar markstory commented on May 18, 2024

@zoidbergwill If you build a tool that can be integrated with lintreview, we could switch tools 😄

from lint-review.

Related Issues (20)

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.