Git Product home page Git Product logo

Comments (4)

sayedihashimi avatar sayedihashimi commented on June 6, 2024

Ok well the larger problem is that VS templates include comments as well. Should we remove those as well?

cc @rustd @madskristensen

from generator-aspnet.

peterblazejewicz avatar peterblazejewicz commented on June 6, 2024

Maybe tooling in VS strips comments before JSON is used? That's common solution, e.g.:
https://github.com/sindresorhus/strip-json-comments
(that is: this could be the reason why VS templates have comments in JSON sources)

from generator-aspnet.

ctolkien avatar ctolkien commented on June 6, 2024

VS will already handle JSON with comments, so I don't think that's the issue, it's more if you're roundtripping with other editors which don't (or developers on other editors).

I'm in two minds, on the one hand, it's against the spec, on the other, comments are genuinely useful and the only editor that seems to choke right now is Sublime, so a workaround could be employed for that.

My current leaning is if JSON is going to be the project format, then it should be valid JSON.

Edit: Crockford's take on this:

I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't.

Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.

https://plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaGSr

from generator-aspnet.

spboyer avatar spboyer commented on June 6, 2024

PR #83 addresses the templates with comments in the project.json files

from generator-aspnet.

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.