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

Fix/locate all prettier configs #97

Merged

Conversation

schaab
Copy link
Contributor

@schaab schaab commented Oct 4, 2019

Fixes #96

What:

The format command does not recognize all local configuration file types

Why:

The docs state that the tool will respect a local configuration for a tool and use that over the default.

How:

Leverage cosmiconfig to search for any type of local configuration. Prettier uses it for config file support. This allows us to look for a module name rather than maintaining a list of files types to look for.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@@ -168,12 +169,20 @@ function writeExtraEntry(name, {cjs, esm}, clean = true) {
)
}

function hasLocalConfig(moduleName, searchOptions = {}) {
Copy link
Owner

Choose a reason for hiding this comment

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

doesn't prettier have a function for finding config? Maybe we should use that instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does.

I was thinking that this eventually this could be used for the other commands as well.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

LGMT 👍 Thanks!

@kentcdodds kentcdodds merged commit 092f1ad into kentcdodds:master Oct 4, 2019
@kentcdodds
Copy link
Owner

@all-contributors please add @schaab for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @schaab! 🎉

@kentcdodds
Copy link
Owner

🎉 This PR is included in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

format does not recognize all prettier config formats.
2 participants