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 5f32204 commit b83b232
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 @@ -42,6 +42,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]).

[#209]: https://github.com/radian-software/apheleia/pull/209
[#229]: https://github.com/radian-software/apheleia/pull/229
Expand Down
2 changes: 1 addition & 1 deletion scripts/formatters/apheleia-npx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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 b83b232

Please sign in to comment.