Skip to content

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

@felipecrs

Description

@felipecrs
Contributor

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: #460

Activity

self-assigned this
on Sep 25, 2020
gustavopch

gustavopch commented on Jan 30, 2021

@gustavopch

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).

pmcelhaney

pmcelhaney commented on Nov 23, 2021

@pmcelhaney
Contributor

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

pmcelhaney

pmcelhaney commented on Jan 5, 2022

@pmcelhaney
Contributor

I'm looking at this today.

added 3 commits that reference this issue on Jan 5, 2022
6472b6e
31e53b1
afb1a82
linked a pull request that will close this issue on Jan 5, 2022
added a commit that references this issue on Jan 5, 2022
6ad54aa
added a commit that references this issue on Oct 31, 2023
636874f
added a commit that references this issue on Nov 5, 2023
ea0b5ee
linked a pull request that will close this issue on Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @pmcelhaney@dmwelch@gustavopch@felipecrs

    Issue actions

      Use cosmiconfig so users can use whatever config file extension they want · Issue #773 · commitizen/cz-cli