Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
It's a data transfer format. Using it for config is already a bad idea, precisely because config files need some things JSON never needed.
-
@Lor-inc I agree that there's nicer options for configuration files — the problem is that the developer isn't the one who chooses JSON, it's the framework or package manager maintainer.
I would rather use TOML or YAML, or even just set up the config as a module/script source file in the same language as the rest of the project... But it's not like I'm going to fork Composer or Yarn just to make it TOML-compatible. -
@C0D4 I've seen that done. I don't 'like it' it seems 'wrong' ... but it's also something I wouldn't argue against.
-
@C0D4 It can break systems though.
I mean, add it to package.json, and npm will probably complain that it can't find a package called "__note" -
C0D4681464y@bittersweet use cases will vary sure,
For npm this is probably the cleanest and safest way to achieve that.
https://www.npmjs.com/package/nps -
@C0D4 Haha yes the solution in the JavaScript ecosystem is always "I think we need a bigger toolchain" 😆
-
@pxeger @Berkmann18 Call me when JSON5 is not just used by devs, but also by package managers and as framework configs.
It's not so much "there are no solutions", it's "adoption rate of possible solutions is low"
No comments allowed in JSON pisses me off so much.
Sure, I get all the arguments of "it's supposed to be a data-only format for machines", "there are alternatives which support comments", and "you can add comments and then minify the file before parsing"
But right now, when I just need to put a quick note inside a super confusing legacy package manager config about why certain dependencies to be frozen at a specific version, IT FUCKING PISSES ME OFF THAT I CAN'T JUST ADD A FUCKING COMMENT.
rant