# Allow Prettier to read the \.editorconfig files of the project when formatting from within Zed \(\#59149\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8589cbbf6bd03672478aae3387a12b9de8d1e67b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8589cbbf6bd03672478aae3387a12b9de8d1e67b

Requested commit: 8589cbbf6bd03672478aae3387a12b9de8d1e67b

Commit: 8589cbbf6bd03672478aae3387a12b9de8d1e67b

Tree: 35e89e600200d745e053014f1b68f81410994017

Author: Matt Harrison

Committer: GitHub

## Message

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

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.

-
https://github.com/prettier/prettier/blob/7e374c3cd024b2bd1b5d88e005aec3718b60f1b6/src/cli/cli-options.evaluate.js#L162
-
https://github.com/prettier/prettier/blob/7e374c3cd024b2bd1b5d88e005aec3718b60f1b6/src/cli/options/get-options-for-file.js#L72

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
  - No tests were found that covered running prettier directly.
- [x] 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.
```

## Parents

- [fca2ccd403e8d13c8f4b968cda2f2c322f420f5a](https://git.cafe/gitcafe/zed/commit/fca2ccd403e8d13c8f4b968cda2f2c322f420f5a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8589cbbf6bd03672478aae3387a12b9de8d1e67b?format=markdown)
