prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Module path can be a dir when loading prettier version

Open enisdenjo opened this issue 2 years ago • 7 comments
trafficstars

It is possible that the modulePath argument passed to loadPrettierVersionFromPackageJson is already a directory (as stated in the prettierPath documentation). In that case, the upwards lookup should start from that directory - not its parent.

  • [x] Run tests
  • [x] Update the CHANGELOG.md with a summary of your changes

enisdenjo avatar Aug 10 '23 14:08 enisdenjo

yeah it'd be really great to get this merged, because currently prettierPath does not work

somebody1234 avatar Sep 21 '23 08:09 somebody1234

well, i guess it works if you point it to /prettier/index.cjs - in which case the documentation is incorrect.

somebody1234 avatar Sep 21 '23 08:09 somebody1234

Any news? @ntotten

enisdenjo avatar Oct 13 '23 15:10 enisdenjo

This pull request has been labeled as stale due to inactivity. Reply to keep this pull request open.

github-actions[bot] avatar Dec 13 '23 01:12 github-actions[bot]

:U

somebody1234 avatar Dec 13 '23 03:12 somebody1234

Bad bot!

enisdenjo avatar Dec 13 '23 10:12 enisdenjo

@enisdenjo thanks for contributing this!

@ntotten we'd love to see this merged. We've got branches of our repo on 2.8.8 and 3.1.1, and we'd love to be able to use the same VSCode workspace settings for both versions.

Right now, we have to use this for 3.1.1

{
    "prettier.prettierPath": "${workspaceFolder}/path/to/node_modules/prettier/index.cjs"
}

And this for 2.8.8

{
    "prettier.prettierPath": "${workspaceFolder}/path/to/node_modules/prettier/"
}

joelrbrandt avatar Dec 30 '23 10:12 joelrbrandt

This pull request has been labeled as stale due to inactivity. Reply to keep this pull request open.

github-actions[bot] avatar Feb 29 '24 01:02 github-actions[bot]

Please merge...

enisdenjo avatar Feb 29 '24 12:02 enisdenjo