Skip to content

Doesn't work with non-node runtimesΒ #3017

@cdmistman

Description

@cdmistman

Summary

In a bun project, I don't have node available in the environment (as I'm using nix to manage my developer environment). This extension seems to invoke the prettier bin directly, which results in the binary failing to run due to the shebang line #!/usr/bin/env node. While prettier should be runtime-agnostic (but understandably probably can't fix this), there should be a setting in the extension that allows you to override the runtime used to run prettier eg bun ./node_modules/.bin/prettier.

Github Repository to Reproduce Issue

https://github.com/cdmistman/bun-plugin-svelte

Steps To Reproduce:

  1. Initialize a Bun project using bun init
  2. bun add prettier -d
  3. Make .prettierrc file
  4. Make some changes to index.ts that violate your .prettierrc
  5. Run this extension's formatter

Expected result

The file is formatted

Actual result

The file is not formatted

Additional information

Feel free to attach a screenshot.

VS Code Version:

1.78

Prettier Extension Version:

9.13.0

OS and version:

MacOS 13.1

Prettier Log Output

["INFO" - 11:47:12 AM] Extension Name: esbenp.prettier-vscode.
["INFO" - 11:47:12 AM] Extension Version: 9.13.0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions