GithubHelp home page GithubHelp logo

jsona / jsona Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 2.38 MB

JSONA parser, linter, formatter, lsp and cli.

Home Page: https://jsona.github.io/jsona/

Rust 90.76% Shell 1.55% JavaScript 1.24% TypeScript 6.45%
formatter jsona lsp parser jsona-parser

jsona's People

Contributors

sigoden avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dalisoft

jsona's Issues

Do you plan continue development of this project?

Seems your project one of fastest JSON Lint/Formatter, not always does it properly for JSON, JSONC but it works very fast


I am creating all-in-one linter (yes, another one) and found your linter fastest JSON linter/formatter.
Here benchmark repo: https://github.com/dalisoft/json-lint-benchmark

I am migrated project into JS ecosystem by using download binary method, see at here if you want check

package-lock.json

| Command                                                                        |    Mean [ms] | Min [ms] | Max [ms] |      Relative |
| :----------------------------------------------------------------------------- | -----------: | -------: | -------: | ------------: |
| `biome check data/package-lock-test.json`                                      |   58.9 ± 1.1 |     57.5 |     61.3 |   7.66 ± 2.10 |
| `prettier -c data/package-lock-test.json`                                      | 180.4 ± 31.0 |    158.1 |    261.2 |  23.47 ± 7.57 |
| `dprint check data/package-lock-test.json`                                     |  199.5 ± 7.1 |    191.8 |    213.3 |  25.96 ± 7.15 |
| `jsona fmt --option trailing_newline=true --check data/package-lock-test.json` |    7.7 ± 2.1 |      6.2 |     13.3 |          1.00 |
| `spectral lint --ignore-unknown-format data/package-lock-test.json`            | 394.4 ± 17.5 |    379.0 |    426.9 | 51.33 ± 14.19 |

package.json

| Command                                                                       |    Mean [ms] | Min [ms] | Max [ms] |       Relative |
| :---------------------------------------------------------------------------- | -----------: | -------: | -------: | -------------: |
| `biome check data/package-template.json`                                      |   49.7 ± 0.9 |     48.2 |     50.7 |   17.58 ± 4.09 |
| `prettier -c data/package-template.json`                                      | 115.4 ± 11.0 |    108.9 |    143.2 |  40.85 ± 10.25 |
| `dprint check data/package-template.json`                                     | 201.5 ± 33.1 |    188.4 |    295.6 |  71.30 ± 20.29 |
| `jsona fmt --option trailing_newline=true --check data/package-template.json` |    2.8 ± 0.7 |      2.0 |      4.2 |           1.00 |
| `spectral lint --ignore-unknown-format data/package-template.json`            | 373.7 ± 31.3 |    359.1 |    460.9 | 132.28 ± 32.65 |

There linked issue/discussions:

Formatting option to match serde-json's default additional whitespace in mappings

I am seeing a lot of diff's like the following in files which were emitted from serde

-                  { "x": 0.0, "y": 0.0 },
-                  { "x": 0.0, "y": 1.0 },
-                  { "x": 1.0, "y": 1.0 },
-                  { "x": 1.0, "y": 0.0 }
+                  {"x":0.0,"y":0.0},
+                  {"x":0.0,"y":1.0},
+                  {"x":1.0,"y":1.0},
+                  {"x":1.0,"y":0.0}

Would be nice if there was an option to add this whitespace for greater readability and compatibility with serde-json.

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.