Commit Graph
18 Commits
Author SHA1 Message Date
fisker Cheung 5017d66ea7 Test: Update printWidth indicator (#10293) 2026-01-31 03:45:41 +08:00
fisker Cheung 7d9933d71f Rewrite tests for 18163 (#18185) 2025-11-01 16:31:33 +08:00
3bc46da961 Add missing parentheses in bitwise operators (#18163)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-10-31 20:45:37 +08:00
fisker Cheung 1520a58879 Fix format of comments around ChainExpression (#17723) 2025-09-12 05:01:51 +08:00
renovate[bot]andfisker a6bbdad8ca chore(deps): update dependency jest to v30.1.1 (#17819)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2025-08-30 15:36:22 +08:00
fisker Cheung b289ecbb19 Remove support for tupleAndRecord (#17363) 2025-04-17 04:53:05 +08:00
fisker Cheung edbc835c9f Fix multiple comments in LogicalExpression and IntersectionType (#17193) 2025-03-05 02:48:25 +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
fisker Cheung d2c415deae Update meriyah to v6 (#16667) 2024-09-18 19:48:57 +08:00
Klaus Hott Vidalandfisker 16449ce914 renaming jsfmt.spec.js to format.test.js (#16244)
Co-authored-by: fisker <lionkay@gmail.com>
2024-05-06 10:25:10 +08:00
fisker Cheung 6eda34db44 Test: Rename run_spec to runFormatTest (#15943) 2024-01-19 17:20:24 +08:00
fisker Cheung b15d287f81 Update Jest to v30 (#15580) 2023-11-27 23:25:58 +08:00
Luca Casonatoandfisker Cheung b78d7c7d2d Disambiguate unary expr in instanceof and in (#15468)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-09-28 14:56:55 +08:00
fisker Cheung 468c514ba2 Fix inconsistent between array/tuple and object/record (#14065) 2023-01-04 15:07:07 +08:00
fisker Cheung 83400d19b4 Change default value of trailingComma to "all" (#11479) 2022-08-01 11:05:17 +08:00
fisker CheungandSosuke Suzuki 6bd81c23b6 Migrate format test to ES Module (#11902)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2022-01-04 17:00:25 +08:00
Sosuke Suzuki 2bbe331f64 Regenerate lockfile (#11458)
* Regenerate yarn.lock

* Fix  tests

* Add yarn.lock to workflow paths
2021-09-07 13:10:54 +09:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00