cosmiconfig icon indicating copy to clipboard operation
cosmiconfig copied to clipboard

cosmiconfig-(meta)-config

Open theKashey opened this issue 4 years ago • 2 comments

Hey! Great library! Using it for a few projects of mine, and that is a problem - the more I use it - the more different files in different places I do have.

Proposal

  • Allow cosmiconfig configuration via config files in the same way it powers end-solutions
  • Allow tapping into config file parsing and discovery, so I can configure other solutions using single configuration file. This is similar, if not equal to having config in package.json, just not bound to the package boundary.
// metaconfig.yml
lintstyled:
  lintstyled-config
prettier:
  prettier-config
  • Allow programmatic override of the functionality above, so I can configure the fleet of my tools in a different way using a "virtual file system", so it would be completely transparent to the end users.
// cosmiconfig.js
export const tapVirtualFile = (folder, pattern) => {
 if (specialFolders.include(folder)) {
   return specialConfigs[pattern]
 }
}

There is no real need to implement this, but I have to describe the opportunity and the possible use cases.

theKashey avatar Aug 27 '21 06:08 theKashey

Hi @theKashey! Are you unable to do these things right now, by customizing your searchPlaces and loaders?

davidtheclark avatar Oct 10 '21 20:10 davidtheclark

Well, if we are speaking about tapping into third-party solutions - then yes, I cannot change their code.

theKashey avatar Oct 11 '21 01:10 theKashey