Skip to content

Allow Prettier to read the .editorconfig files of the project when formatting from within Zed#59149

Merged
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
matt-h:prettier-editorconfig
Jun 13, 2026
Merged

Allow Prettier to read the .editorconfig files of the project when formatting from within Zed#59149
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
matt-h:prettier-editorconfig

Conversation

@matt-h

@matt-h matt-h commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

allow Prettier to read the .editorconfig files of the project when formatting from within zed.

Prettier's API requires passing the { editorconfig: true } option to read .editorconfig files. The prettier CLI uses this option by default when running but the API does not.

API Option for this: https://prettier.io/docs/api#prettierresolveconfigfileurlorpath--options

Code where the CLI of prettier defaults this to true to show this option aligns with Prettier's defaults.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
    • No tests were found that covered running prettier directly.
  • Performance impact has been considered and is acceptable

Closes #10828

Release Notes:

  • Allow Prettier to read the .editorconfig files of the project when formatting from within zed.

…rmatting from within zed.

Prettier's API requires passing the `{ editorconfig: true }` option to read .editorconfig files. The prettier CLI uses this option by default when running but the API does not.

Fixes zed-industries#10828
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 11, 2026
@maxdeviant maxdeviant changed the title allow Prettier to read the .editorconfig files of the project when formatting from within zed. Allow Prettier to read the .editorconfig files of the project when formatting from within Zed Jun 11, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 11, 2026

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable, thanks!

@ChristopherBiscardi ChristopherBiscardi self-assigned this Jun 13, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:tooling/prettier Prettier tooling support label Jun 13, 2026
@ChristopherBiscardi ChristopherBiscardi added this pull request to the merge queue Jun 13, 2026
Merged via the queue into zed-industries:main with commit 8589cbb Jun 13, 2026
78 of 80 checks passed
@sachahjkl

Copy link
Copy Markdown

Thank you so much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tooling/prettier Prettier tooling support cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.editorconfig ignored by built-in formatters like Prettier and Lua

3 participants