Skip to content
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

Change configuration loading to cosmiconfig #420

Closed
wants to merge 3 commits into from
Closed

Change configuration loading to cosmiconfig #420

wants to merge 3 commits into from

Conversation

bunysae
Copy link

@bunysae bunysae commented Feb 12, 2020

Changed configuration loading to cosmiconfig module. As @sindresorhus mention YAML is disabled.
Fixes issue #330 and superseded PR #331 as this seems no longer maintained.

`${moduleName}.config.js`];
const loaders = {noExt: defaultLoaders['.json']};
// Change working directory for load config
process.chdir(options.cwd);
Copy link
Contributor

@pvdlg pvdlg Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the working directory directory, pass options.cwd to comisconfig in option searchFrom: https://github.com/davidtheclark/cosmiconfig#searchfrom

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I didn't saw this option before.

@sindresorhus
Copy link
Member

Thanks for working on this. It would be good with some more tests. And it also needs to be documented in the readme.

@bunysae
Copy link
Author

bunysae commented Feb 13, 2020

I added tests for every variety and changed the docs with my latest commit.

@sindresorhus
Copy link
Member

Sorry @bunysae... I went with #425 as it was much more complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants