editorconfig: Only search for .editorconfig up to the VCS directory#3559
editorconfig: Only search for .editorconfig up to the VCS directory#3559azz merged 4 commits intoprettier:masterfrom
Conversation
This addresses prettier#3558 I'm not sure if this is the best way to find the "project root", but it seems better than before.
|
Would this impact the behavior of something like What about monorepo/lerna-style projects, which might have something like this: I actually don't know prettier's current behavior here, or what's desired. |
|
I think finding the VCS directory might work? Something like https://npmjs.com/package/find-project-root? Not sure... |
|
Yeah @azz, I think finding the VCS directory would work far better, and handle the cases that @rattrayalex pointed out. One potential issue is that projects that don't use source control wouldn't be able to take advantage of the |
This uses [find-project-root] to find the nearest directory containing `.git` or `.hg` See here for context: prettier#3559 (comment) [find-project-root]: https://github.com/kirstein/find-project-root
|
Actually, any way we could add a test for this? |
|
Do the docs for I'm not sure we need a test if we're using a third-party-package that has tests. looks at npm package ah, it doesn't even have a repo listed. |
|
Here's the tests: https://github.com/kirstein/find-project-root/blob/master/test/index.spec.js I'd like to have one integration test for this though to document the expected behaviour. |
It's a little hacky in that the .hg file isn't really a Mercurial repository, but it's enough to illustrate the intent. See here for context: prettier#3559 (comment)
|
I added a quick test in d9b2447. I also noticed that the |
|
Thanks! I'm less concerned about prettierrc because that's a more explicit intent. |
|
Good point @azz, thanks for merging. |
This addresses #3558
I'm not sure if this is the best way to find the "project root", but it
seems better than before.