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

feat(resolver): skip inappropriate directories in ancestors traversal #325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KonanMentor
Copy link

Summary

This PR fixes resolving of locally installed prettier executable in multi packages repositories with hoisted dependencies.

Please consider the following files structure:

.
├── index.ts              <--- PrettierCliPath is correctly resolved to the locally installed executable
├── node_modules
│   └── .bin
│       └── prettier
├── package.json          <--- Root package with prettier installed as a dev dependency
└── packages                  that should be used for all source files in this repository
    └── some-package
        ├── index.ts      <--- PrettierCliPath SHOULD be resolved to the ../../node_modules/.bin/prettier
        ├── node_modules
        │   └── .bin
        └── package.json  <--- One of the mono repository packages that may have its own
                               dependencies. But it doesn't have prettier in its node_modules/.bin

Without this PR the resolved cli path for ./packages/some-package/index.ts is globally installed or the plugin's version of prettier.
With this PR the resolved path is ./node_modules/.bin/prettier.

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.

None yet

1 participant