Tools: Project config file - minimize API

Created on 28 Feb 2020  路  7Comments  路  Source: rome/tools

One of the project goals is to minimize the API, but right in the getting started guide, we see the project configuration "can take three possible forms": rome.json, rome.rjson or "rome" entry in package.json.
Already too many options. Is there a case where a project won't have a package.json!?

IMHO we should stick to "rome" entry in package.json.

Most helpful comment

I think I would prefer having support for *.js / *.ts configuration file as some options might be useful to resolve at runtime, like checking custom command line arguments. Some tools even have support for a default exported async function that resolves the configuration.

All 7 comments

package.json can and already is already pretty crowded. Minimizing the API to me does not mean limiting the choices in how to do configuration, but in having less configuration.

Already too many options. Is there a case where a project won't have a package.json!?

Yes. You can have subprojects with different settings. package.json also doesn't allow comments which is one of the greatest advantages of RJSON #13.

I don't think this is a good idea because a lot of people are used to config files instead of putting everything to package.json

importing either json from the config or package.json won't make a huge difference. Both can be supported, it won't lose much in performance (as I think)

Also in favor of removing package.json and having only rome in package.json and rome.rjson.

Please no config in package.json, it's the most restrictive format. Hell, even JSON is an awful config format.

@milesj Hence RJSON #13. I don't see a problem with allowing people to put it in there if they want, especially if the config is only very small.

I think I would prefer having support for *.js / *.ts configuration file as some options might be useful to resolve at runtime, like checking custom command line arguments. Some tools even have support for a default exported async function that resolves the configuration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebmck picture sebmck  路  5Comments

yoshixmk picture yoshixmk  路  4Comments

RaviVaranasi picture RaviVaranasi  路  5Comments

ChristopherBiscardi picture ChristopherBiscardi  路  5Comments

linvain picture linvain  路  4Comments