cz-cli icon indicating copy to clipboard operation
cz-cli copied to clipboard

Use cosmiconfig so users can use whatever config file extension they want

Open felipecrs opened this issue 5 years ago • 3 comments
trafficstars

With cosmiconfig we could automatically load the configuration file from whatever supported file, such as:

  • a package.json property
  • a JSON or YAML, extensionless "rc file"
  • an "rc file" with the extensions .json, .yaml, .yml, .js, or .cjs
  • a .config.js or .config.cjs CommonJS module

I'm personally looking for a .czrc.json, so my VSCode can automatically detect it as JSON.

Nonetheless, this would reduce a lot of code from this repo.

https://github.com/davidtheclark/cosmiconfig

Related: https://github.com/commitizen/cz-cli/issues/460

felipecrs avatar Aug 27 '20 22:08 felipecrs

My use case: I want to use .js to be able to import emojis from other file (my semantic-release and commitlint configs also import from there).

gustavopch avatar Jan 30 '21 17:01 gustavopch

Just found out about lilconfig which has the parts of cosmiconfig that matter and zero dependencies.

pmcelhaney avatar Nov 23 '21 16:11 pmcelhaney

I'm looking at this today.

pmcelhaney avatar Jan 05 '22 16:01 pmcelhaney