-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define a unified "config.json" format #4090
Comments
As an alternative to this, if people think that the config.json file may get too large if it is expanded with different keys, another option might be to do nothing more than segregate and standardize those config files. As in:
Does that make more sense? |
In addition, supplying a schema for the settings of that file is also a brilliant addition, and necessary for IDE integration. I think this is fantastic: http://json.schemastore.org/tsconfig Would there be a way to standardize that as well (and perhaps define it at the library repo level for discovery)? |
I don't know that we're in a position to define a config file standard for the universe of JavaScript tools. If there were a standard already, we would certainly sign on. Somehow herding together a dozen or so popular tools and getting them all to agree on a file format might be a good way to bootstrap that process, though. Obligatory https://xkcd.com/927/ 😉 |
@RyanCavanaugh lol, one of my favorite XKCD comics.
Right, no time like the present? ;-) Okay, if it's not in TypeScript's wheelhouse right now, that's okay. But as an IDE developer, it's distressing to come across these various config formats. Automatically import the tsconfig.json file? Or just persist those settings to the application configuration storage? What if they change in-app configuration, and also make different changes to tsconfig.json? Sync changes back out? Does that mean writing out and syncing to different config files, in different formats? Maybe it's not that much of a problem, and people would be happy to define settings twice. Or happy to learn the schema of different config formats. I dunno, it just seems crazy to me right now. |
It is crazy. It's just a straightforward example of Tragedy of the Commons -- when you come along and there are 627 different config file formats, adding the 628th doesn't seem like a big deal, and having a config file today is much better for you than waiting (forever) for everyone else to standardize before you make your config file. It's similar to how despite having commandline tools for over 40 years, there's still no universal commandline format! It's going to be very difficult to solve that problem because anyone who tries to move to a putative standard is going to expend resources to deal with two formats at once, but with no guarantee that everyone else is going to move to the same standard. A recognized standards body providing an official recommendation, or a quorum of major players all simultaneously announcing their intent to move to the same standard, would really be the only plausible first steps. |
Dear TypeScript community,
Various communities have been trying to solve the same problem: a way to persist the settings passed to a command-line compiler, that is also easily readable by an IDE.
The Less.js discussion: less/less.js#1893
The TypeScript discussion: #1667
I'm sure there are more. TypeScript recently decided to use a tsconfig.json file to serve this need. But, rather than have proprietary / competing config.json formats which litter the root directory of a project, I propose two things, for this community, Less.js's and others:
.config
folder. Everyone is putting their own "project start" files in root, and our repos are getting cluttered.For the TypeScript community, it might make sense to support both config.json and tsconfig.json, since the latter is already implemented. The former could simply look like:
Note: I'm not sure if
config.json
is too generic a name to use on a widespread basis, but certainlytsconfig.json
is too specific to be co-opted by other libraries in an effort for simplicity (and not, by spec, expandable anyway).What do you think?
The text was updated successfully, but these errors were encountered: