Commit Graph
607 Commits
Author SHA1 Message Date
Paul DraperandSosuke Suzuki bef1d61a7a Implement objectWrap config option (#16163)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2025-01-15 16:44:45 +09:00
eed53fc29a Break lines before binary operators (#7111)
* Add additional binary expression comment tests

Refs #3806

These cover a few edge cases I encountered while maintaining
`@btmills/prettier` over the last few years. I'm adding them up front to
demonstrate that the `experimentalOperatorPosition` changes in a later
commit have no effect on this formatting when the flag is not enabled.

* Define experimentalOperatorPosition flag

Refs #3806

This merely defines the flag. A future commit will use it in updated
logic.

* Add experimentalOperatorPosition default tests

Right now, this flag isn't implemented, so these tests duplicate the
existing behavior. I'm adding them now so that when I implement the
flag's logic in a future commit, the changed formatting will be obvious
in the diff and easier to review.

* Implement experimentalOperatorPosition flag

Fixes #3806 as requested in https://github.com/prettier/prettier/pull/7111#issuecomment-2252623779

The flag's tests were already added in a previous commit, so the test
changes you see in this commit are specifically due to the new flag's
implementation.

* Document experimentalOperatorPosition flag

* Change operator position option start|end

In response to https://github.com/prettier/prettier/pull/7111#discussion_r1729382119

* Add TS intersection line wrapping tests

This clones TypeScript's type union operator tests in `union-parens.ts`
and swaps the operators (& <-> |) to test the the type interesection
operator. It also runs intersection tests with the new
`experimentalOperatorPosition: "start"` flag. This does _not_ yet update
the implementation to consider the flag; to ease review, I'll make that
change in the next commit to isolate the impact of the change.

* Apply experimentalOperatorPosition: start to type intersections

The type union operator was already formatted at the beginning of lines
by default, so that logic didn't need to be updated.

* Update 7111.md

* Update tests after rebasing

I rebased from 1dfe28f85 to c7066780e to fix test failures related to
https://github.com/prettier/prettier/pull/16601. The rebase applied
cleanly, and this was the only change to tests. Since the PR has
already been approved, I'll keep this as a separate commit rather than
squashing into the prior commits.

---------

Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2025-01-04 01:30:51 +09:00
Norbert Elterandfisker 84de783ce6 Add support for TS config files (#16828)
* feat: prettier.config.ts

* revert

* feat: add flag

* fix: remove experimental warning

* Revert changes

* Add tests

* Update docs

* Only test on Node.js v22

* Add changelog

* Update docs

* Update examples

* Fix changelog

* Fix command

* Name `loadJs` back

* Fix

---------

Co-authored-by: fisker <lionkay@gmail.com>
2024-12-21 15:39:45 +09:00
seyeong cf00f641b5 docs: Update Husky setup commands for PNPM users (#16943)
- Replace `npx husky init` with `pnpm exec husky init`
- Update installation command to use pnpm
- Add PNPM-specific pre-commit hook setup command
2024-12-21 15:31:49 +09:00
Joel García Nuñoandfisker Cheung 6fe195b1b1 docs: fix angular link (#16822)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-11-25 23:40:45 +08:00
Salvatore Testa 18f0056a9d Fix Yarn installation instructions to use yarn (#16799)
The pre-commit hook currently specifies `npx` instead of `yarn` for the Yarn project.
2024-10-30 15:27:37 +09:00
Maria José Solano 2f409df61d fix(docs): complete sentence for astFormat (#16774) 2024-10-24 16:30:44 +09:00
Lehoczky Zoltán e7ca215c3c docs: add detailed guide for shared configs (#16495) 2024-10-18 14:57:01 +08:00
Marcus Pettersen Irgensandfisker Cheung 5bb04801a2 Ignore files in the Jujutsu directory (#16684)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-09-27 19:53:37 +08:00
Christian Oliff 90f036500c Docs: HTTPS link to Less site (#16568) 2024-08-26 08:26:16 +08:00
Klaus Hott Vidal 1e15157090 reorganizing getPreferredQuote documentation (#16575) 2024-08-16 07:26:55 +09:00
SUZUKI Sosuke 3cf3f5ac29 Make getPreferredQuote public (#16567) 2024-08-14 09:34:58 +09:00
Alex Piechowski 509a0cc10f Add oxford comma to Single Attribute Per Line doc (#16566) 2024-08-13 07:33:07 +09:00
Yuhei Yasuda 5c60b9ef4a Fix code example for prettier.resolveConfig (#16525) 2024-08-10 09:52:30 +08:00
Kenneth Sills 5923e69901 docs: document the special treatment of machine-generated files (#16541)
Closes #11553
2024-08-10 00:28:09 +01:00
Nasicus fe7b985d67 docs: use oneliner to create .prettierignore file (#16245) 2024-06-18 08:14:55 +09:00
Alex Ford ad223eda4a Remove mention of options.editorconfig which does not exist. (#16335) 2024-06-18 08:13:50 +09:00
Matteo Agnoletto 4bafc9bb6d Add link to reviewdog-action-prettier (#12648) 2024-06-11 17:17:13 +08:00
fisker Cheung 2fbe7059ac Use prettier version placeholder in docs/ (#16360) 2024-06-11 09:18:16 +08:00
fisker 92cbd33475 Release 3.3.1 2024-06-05 17:08:40 +08:00
Sosuke Suzuki c4ab460357 Release 3.3.0 2024-06-02 02:01:15 +09:00
Sunshio 6408ec01dd docs: Fix git-format-staged in precommit documentation (#16152) 2024-05-13 10:01:13 +08:00
Daniel Bayleyandfisker Cheung da772ff1f0 feat: add support for package.yaml config (#16157)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-05-10 18:36:44 +08:00
TOMIKAWA Sotaro 923eec3afe docs: getValue() replaced with node (#16224) 2024-04-30 22:07:40 +09:00
Bart Louwers 470d04e119 Remove pre-commit from precommit.md (#16229) 2024-04-29 00:52:42 +01:00
Sunshioandfisker Cheung 09316aa830 docs: Add documentation for Bun.sh (#16153)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-04-10 17:40:26 +08:00
Hamir Mahal 6215520007 docs: add @see to improve self-documentation (#16188) 2024-04-06 19:24:18 +09:00
Philipp Lühmann 6c0e24d6f3 docs: Fix broken link to Helix wiki (#16185) 2024-04-04 22:53:50 +08:00
Timon Jurschitsch 572452b89d Update configuration.md (Add spaces for readability) (#14770) 2024-02-18 23:38:18 +08:00
Matt d'Entremont 4aebc0ecc8 Add "--write" to the prettier failure output (#16062) 2024-02-14 09:16:13 +00:00
Sosuke Suzuki 7142cf354c Release 3.2.5 2024-02-04 14:35:44 +09:00
ohaddahanandfisker Cheung 08f19401e4 Update install script for husky v9 (#16000)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-02-03 20:44:32 +08:00
fisker Cheung 09024bac75 Add @prettier/sync to docs (#15977) 2024-01-28 16:31:36 +08:00
fisker 03822f5b34 Release 3.2.4 2024-01-17 18:04:57 +08:00
fisker 42ba4373f4 Release 3.2.3 2024-01-17 11:27:30 +08:00
fisker Cheung ff83d55d05 Update documentation for prettier.resolveConfig() (#15910) 2024-01-14 10:03:16 +00:00
Sosuke Suzuki 5f2c6df462 Release 3.2.2 2024-01-14 12:06:14 +09:00
Aurélien Mino 12ab54898c Add prettier-plugin-gherkin to the community plugins list (#15919)
Add prettier-plugin-gherkin in community plugins
2024-01-14 11:41:45 +09:00
Sosuke Suzuki 48ad20859b Release 3.2.1 2024-01-13 04:14:41 +09:00
Sosuke Suzuki 29f299f73e Release 3.2.0 2024-01-13 01:13:35 +09:00
fisker Cheung 45ad4668eb Fix a TODO (#15902) 2024-01-10 00:49:17 +08:00
Kristjan ESPERANTOandfisker Cheung 4d07f5a8b2 Use .prettierrc consistently in docs (#15683)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-01-03 13:01:22 +08:00
fisker Cheung 1dc924f2f2 Add jsonc parser (#15831) 2024-01-02 10:59:34 +08:00
Kevin Gibbons cb6fea81fb Avoid introducing linebreaks in template interpolations (#15209) 2023-12-17 18:10:20 +08:00
Sosuke Suzuki b86701dd1d Release 3.1.1 2023-12-10 17:33:43 +09:00
Mark Amery 1e30f66f39 Remove claim, untrue since over 5 years ago, that cursorOffset is incompatible with rangeStart/rangeEnd (#15750) 2023-12-08 16:35:02 +02:00
fisker Cheung 5f0956bc30 Implement our own config explorer (#15663) 2023-12-05 15:00:43 +08:00
Arnaud 457e83a725 docs: update the JSON schema location to use https (#15674) 2023-11-18 15:51:29 +09:00
Sosuke Suzuki e8ac9f8d2a Release 3.1.0 2023-11-13 11:53:15 +09:00
9ebcf9b0ff Update docs to mention gitignore changes (#15134)
Co-authored-by: awsr <43862868+awsr@users.noreply.github.com>
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2023-11-12 22:51:41 +08:00