Skip to content

Commit

Permalink
Don't give node_modules more wheight than .pnp.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeorin committed May 1, 2024
1 parent 23cebcc commit d37fbd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ The format is based on [Keep a Changelog].
loader. ([#301])
* `apheleia-npx` did not correctly guard against word splitting.
([#301])
* `apheleia-npx` was sometimes not able to find formatters in a Yarn
PnP project if there was also a node_modules folder at the root of
the project ([#301]).

### Internal
* Major internal refactoring has occurred to make it possible to write
Expand Down
2 changes: 1 addition & 1 deletion scripts/formatters/apheleia-npx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ -d $dir ]]; then
pnp_root="$(find_upwards .pnp.cjs)"
npm_root="$(find_upwards node_modules)"

if [[ -n ${pnp_root} && ${#pnp_root} -gt ${#npm_root} ]]; then
if [[ -n ${pnp_root} ]]; then
# trying pnp
pnp_path="${pnp_root}/.pnp.cjs"
bin="$(${pnp_bin} "${pnp_path}" "$1")"
Expand Down

0 comments on commit d37fbd2

Please sign in to comment.