Commit Graph
243 Commits
Author SHA1 Message Date
Remco HaszingandSUZUKI Sosuke 9cf8ec23f6 Support dockercompose and github-actions-workflow (#17101)
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2025-02-12 11:41:11 +09:00
renovate[bot] 36460be18f chore(deps): update dependency file-entry-cache to v10 (#16725) 2025-01-17 23:48:00 +08:00
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
fisker Cheung 6f12b94ae9 Fix tests for ts config (#16970) 2025-01-08 10:00:39 +08: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
fisker Cheung 730770e29a Add tests for #16857 (#16940)
* Add tests for #16857

* Update comment
2024-12-21 15:32:30 +09:00
fisker Cheung c450b6ad8e Remove TLA from jest.config.js (#16938) 2024-12-16 11:19:18 +08:00
fisker Cheung 07b468917e Remove blank lines between imports (#16450) 2024-09-29 17:56:37 +08:00
fisker Cheung 69f419213e Revert "Pin Node.js to v22.6.0" (#16642) 2024-09-27 20:26:48 +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
Seiya 14d7f1536f Fix rule of fill violations in utils and tests (#16656) 2024-09-27 17:59:35 +08:00
SUZUKI Sosuke 3cf3f5ac29 Make getPreferredQuote public (#16567) 2024-08-14 09:34:58 +09:00
fisker Cheung c6ea73f93a Update test for --debug-print-ast (#16518) 2024-07-27 04:05:58 +08:00
fisker Cheung 407f1a0056 Switch @iarna/toml to smol-toml (#16497) 2024-07-26 19:38:07 +08:00
fisker Cheung c03a12ad2b Enable require-unicode-regexp and regexp/strict rule (#16408) 2024-06-18 07:52:54 +09:00
sjtucoderandfisker Cheung 22dad9c1a8 chore: fix some comments (#16410)
Signed-off-by: sjtucoder <sjtucoder@icloud.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-06-18 07:51:54 +09:00
fisker Cheung b26f56bd31 Update eslint-plugin-unicorn to v53 (#16275) 2024-06-04 09:39:19 +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
Seiya 063978a592 Correct invalid fill() in markdown paragraph print (#16158) 2024-04-06 19:25:30 +09:00
Matt d'Entremont 4aebc0ecc8 Add "--write" to the prettier failure output (#16062) 2024-02-14 09:16:13 +00:00
SUZUKI Sosukeandfisker Cheung cc6435cc75 Use "json" parser for tsconfig.json by default (#16012)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-02-03 18:49:18 +08:00
fisker Cheung 91a2e2513e Fix schema (#15962) 2024-01-22 00:02:31 +08:00
fisker Cheung 1cd4d9c160 Fix JSONC filenames list (#15947) 2024-01-17 18:02:25 +08:00
fisker Cheung c566c9df08 Fix parser inference (#15927) 2024-01-16 10:34:05 +08:00
fisker Cheung 1dc924f2f2 Add jsonc parser (#15831) 2024-01-02 10:59:34 +08:00
Alexander Kachkaev 1ea2fd059a Add eslint-plugin-simple-import-sort (#15817) 2023-12-18 03:34:12 +08:00
fisker Cheung 44949eb5dc Support absolute path in config file (#15666) 2023-12-13 16:16:15 +08: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
Sander Maijersandfisker 8e816ade2e Allow skipping symlink patterns, to avoid raising a fault (#15533)
Co-authored-by: fisker <lionkay@gmail.com>
2023-12-08 01:54:18 +09:00
fisker Cheung 5f0956bc30 Implement our own config explorer (#15663) 2023-12-05 15:00:43 +08:00
fisker Cheung 117c04fcc8 Simplify mockable (#15729) 2023-12-05 14:39:11 +08:00
fisker Cheung b15d287f81 Update Jest to v30 (#15580) 2023-11-27 23:25:58 +08:00
Arnaud 457e83a725 docs: update the JSON schema location to use https (#15674) 2023-11-18 15:51:29 +09:00
fisker Cheung 1b21096744 Make findProjectRoot async (#15672) 2023-11-17 21:44:39 +08:00
fisker ba258537e3 Improve coverage 2023-11-17 01:46:48 +08:00
fisker b5313a5a5a Improve coverage 2023-11-17 01:39:55 +08:00
fisker Cheung e4a74c05f4 Fix argument passed to lilconfig.search() (#15363) 2023-11-16 01:05:57 +08:00
Pierre-Marie Dartus a8bf66ae63 Remove unused findParentDir (#15651)
Drop unused  dependency
2023-11-13 15:29:33 +08:00
Sosuke Suzuki eebf0e4b5e Bump Prettier dependency to 3.1.0 2023-11-13 12:00:57 +09:00
0176a33db4 Support angular control flow (#15606)
Co-authored-by: dweizhe <d.weizhe@anyong.com.tw>
Co-authored-by: fisker <lionkay@gmail.com>
2023-11-12 20:01:30 +08:00
fisker Cheung 1a00467677 Fix error when formatting file names contains square brackets or dots (#15597) 2023-11-07 10:25:24 +08:00
renovate[bot]andfisker ba6512a88f chore(deps): update dependency linguist-languages to v7.27.0 (#15557)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2023-10-28 02:40:42 +08:00
4aa5fd1c79 New Ternary Formatting: A Curious Case of the Ternaries (#13183)
Co-authored-by: Alex Rattray <rattrayalex@stripe.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2023-10-09 10:44:30 +09:00
ADTC 7e67e43061 Show (unchanged) keyword for accessibility in CLI --write (#15467) 2023-10-09 08:40:28 +09:00
SUZUKI Sosuke 9f06cdd5b0 Process files only supported by plugins (#15433) 2023-09-25 14:45:01 +09:00
fisker Cheung 6c833b4445 Support URL as ignorePath in getFileInfo() (#15364) 2023-09-14 20:10:10 +08:00
fisker Cheung 98ae581402 Minor tweak to CLI (#15366) 2023-09-07 16:32:43 +08:00
fisker Cheung b9a3995e3a Refactor: Accept URL in isIgnored and inferParser (#15361) 2023-09-07 09:27:39 +08:00
fisker Cheung b2c33a4cec Accept URL in getFileInfo (#15360) 2023-09-06 15:49:22 +08:00