Commit Graph
272 Commits
Author SHA1 Message Date
Leonardo Montiniandfisker abb43bf287 Forbid use --config and --no-config together (#12221)
Co-authored-by: fisker <lionkay@gmail.com>
2025-05-27 09:16:26 +08:00
renovate[bot]andfisker bba5dc430c chore(deps): update dependency file-entry-cache to v10.1.0 (#17438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-05-27 09:06:53 +08:00
fisker Cheung 275fc2eb69 Improve isSupported() (#17490) 2025-05-20 13:19:15 +08:00
renovate[bot]andfisker 8f666df193 chore(deps): update dependency linguist-languages to v7.30.0 (#17435)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-05-07 10:15:15 +08:00
fisker 60fcf1ae31 Fix CLI test flags 2025-05-06 11:57:42 +08:00
fisker Cheung d4fd92e266 Bundle "Experimental CLI" (#17396) 2025-05-06 10:34:05 +08:00
fisker Cheung 59c635b939 Correctly parse <mj-style> and <mj-raw> (#17400) 2025-05-06 10:31:59 +08:00
fisker Cheungandautofix-ci[bot] 38dc5dee18 Parse Prettier config with yaml (#17410)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-06 08:18:50 +08:00
fisker Cheung e7202d63e7 Refactor mockable functionalities (#17392) 2025-04-23 23:42:19 +08:00
fisker Cheung 369817b61f Measure time with performance.now() instead of Date.now() (#17390) 2025-04-23 02:51:20 +08:00
fisker Cheung a8557aa6df Remove stdin mock (#17389) 2025-04-23 02:30:55 +08:00
fisker Cheung 8c7aa6957b Remove outdated mock (#17391) 2025-04-23 02:25:01 +08:00
fisker Cheung 05a5ff54d0 Add failed test back (#17384) 2025-04-22 17:17:47 +08:00
fisker Cheung 6f4c89f8f9 Update snapshot format for CLI test (#17386) 2025-04-21 23:34:55 +08:00
fisker Cheung 42346f2ef7 Run CLI test in child_process (#17382) 2025-04-21 18:58:44 +08:00
Will Nayesandfisker 21c6f43612 Ignore single files with @noformat / @noprettier (#17344)
Co-authored-by: fisker <lionkay@gmail.com>
2025-04-18 21:28:47 +08:00
JounQinandfisker Cheung c93393c0be Add isSupported function support for language (#17331)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-04-14 09:15:43 +08:00
fisker Cheung b3d1f8cdc2 Add mjml parser (#17339) 2025-04-14 08:12:53 +08:00
fisker Cheung fe536ff6b1 Remove extra lines in --file-info and --support-info (#17332) 2025-04-09 15:23:50 +08:00
fisker Cheung 377b231a5d Bundle package into dist/prettier/ (#15825) 2025-04-09 08:38:46 +08:00
fisker Cheung 39e9cabdf5 Support cursorOffset in prettier.__debug.printToDoc() (#17256) 2025-03-17 11:16:46 +08:00
renovate[bot]andfisker 27196f9be0 chore(deps): update dependency linguist-languages to v7.29.0 (#17222)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-03-11 13:49:13 +08:00
renovate[bot]andfisker 1a48db46ed chore(deps): update dependency vnopts to v2.0.2 (#17221)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-03-08 19:36:56 +08:00
fisker Cheung 9dac37c608 Replace benchmark with tinybench (#17132) 2025-02-26 16:06:02 +08:00
fisker Cheung 1c616b292e Don't interpret *.frag files as JavaScript files (#17178) 2025-02-26 15:53:21 +08:00
fisker Cheung 9eb1b341cd Add assertions to location sensitive nodes (#17141) 2025-02-26 15:52:31 +08:00
fisker Cheung 5dc7e8e54a Accept URL as custom config file in resolveConfig (#17167) 2025-02-25 08:46:15 +08:00
fisker Cheung e830ad36a7 Support URL in plugins options (#17166) 2025-02-25 08:45:25 +08:00
fisker Cheung 64e7dab1fd Fix links to Prettier/Babel/Jest website (#17079) 2025-02-15 12:18:09 +08:00
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