Commit Graph
2200 Commits
Author SHA1 Message Date
Sosuke Suzuki fd376000e9 Update @typescript-eslint/typescript-estree to support satisfies (#13872)
* Update to `5.43.1-alpha.22`

* Update snapshots for satisfies

* Update changelog

* Remove `@ts-expect-error` comment

* Yarn dedupe

* Update to stable version

* Fix changelog

* Fix changelog
2022-11-22 15:19:28 +09:00
Sosuke Suzuki ff0529ac2e Backport "Support TS4.9 satisfies operator (#13764)" (#13783) 2022-11-04 10:35:50 +08:00
MillyandSosuke Suzuki ca246aface Fix --cache set only if with --write or no-different (#13016)
* Fixed typo

* Return early if file does not exist

* Added tests for cache

* Added `mockWriteFileErrors` option to run helper

* Added tests for write error

* Remove files with differences from cache

* Add `getCliArguments` utility function

Refactor

* Fix lint

* Revert "Fix lint"

This reverts commit 18be64b7c42cd669496d59ff64bd534b8e03c3df.

* Revert "Add `getCliArguments` utility function"

This reverts commit d653fe10a92390102ae97cb43b2efcbb5c3c9140.

* Refactor with `cliArguments` variable

Co-authored-by: Sosuke Suzuki <sosuke.suzuki@dr-ubie.com>
2022-10-24 23:55:36 +09:00
Anders Kaseorg f38111fec6 markdown: Preserve inline code line breaks if --prose-wrap=preserve (#11373) 2022-10-09 16:53:12 +03:00
Jed Fox bfb09bf214 Format pseudo-selector args like a function call (#13577) 2022-10-02 11:11:44 -04:00
2bbbe1a8d1 Improve MDX range ignore support (#12208)
Co-authored-by: Nick Rutten <nickrttn@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-09-28 10:02:17 +08:00
James C. Davisandfisker Cheung 38611cb16e [handlebars] correctly format custom "else if" blocks (#13507)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-09-26 11:04:50 +08:00
fisker Cheung 2bc757554b Update acorn & espree (#13506) 2022-09-22 19:11:34 +08:00
5a627651ff fix: line breaks in multiline strings, issue 13157 (#13274)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
Co-authored-by: Gleb Dolzhikov <gleb.dolzhikov@ix.co>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-08-23 20:56:52 +08:00
Gleb DolzhikovandGleb Dolzhikov f2244bdc86 Fix parens in inferred function return types with extends (#13289)
Co-authored-by: Gleb Dolzhikov <9276677@gmail.com>
2022-08-17 18:36:25 +03:00
José Pereiraandfisker Cheung 2d3a274847 fix: extra space between '#' and '{' (#13286)
* fix: extra space between '#' and '{'

* Update src/language-css/printer-postcss.js

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* adding changelog

* Update 13286.md

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-08-17 23:32:29 +09:00
t-mangoeandSosuke Suzuki 00ec91bfde Added condition for '+' case. (#13115)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2022-08-08 01:08:28 +08:00
Sosuke SuzukiandHolger Jeromin 955553bb39 Add --cache-location option (#13019)
* Implement searching cache file from `--cache-location` option

* Add tests

* Add docs

* Fix

* Fix doc

* Add changelog

* Update snapshots

* Update docs

* Update docs/cli.md

Co-authored-by: Holger Jeromin <mailgithub@katur.de>

* Fix changelog

* Remove directory support

* Update docs

* Update tests

* Update docs

* Add validation for dir

* Fix comment

* Update option description

* Validate JSON

* Use `path.resolve`

Co-authored-by: Holger Jeromin <mailgithub@katur.de>
2022-07-31 22:58:05 +09:00
Georgii Dolzhykov cd9955f143 Fix range format for function bodies (#13173) 2022-07-25 12:28:24 +03:00
fisker Cheung 8ee0c6354d Fix ifBreak check in fits (#12362) 2022-07-23 18:02:05 +08:00
Sosuke Suzuki 89f90fc013 Insert spaces in pipe (#13100)
* Insert spaces to pipe arguments

* Update snapshots

* Add changelog

* Fix lint problem
2022-07-16 17:18:55 +09:00
fisker Cheung 811b591ee8 Update dependency jest-docblock to v28.1.1 (#13054) 2022-07-11 10:03:49 +08:00
Or Rosenblatt a00d31e1a4 Support .lintstagedrc (#13081)
* Test `.lintstagedrc` JSON and YML formatting (TDD)

* Support `.lintstagedrc` formatting

* Update spell checking for `.lintstagedrc`

* Update changelog

* Update changelog
2022-07-09 13:30:26 +09:00
fisker Cheung a043ac0d73 Update dependency @typescript-eslint/typescript-estree to v5.30.0 (#13053) 2022-06-28 14:22:10 +08:00
Huáng Jùnliàng 9dd761a6e4 fix: JSON modules disable named exports (#13035) 2022-06-23 02:05:46 +08:00
Huáng Jùnliàng b0201e01ef fix: JSON modules disable named exports (#13031) 2022-06-21 10:56:00 +08:00
chimuraiandfisker Cheung 794d9d1558 bugfix(graphql): Keep useful empty lines in description (#13013)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-06-16 13:33:09 +08:00
fisker Cheung d2bcaea121 Throw errors for invalid TSEmptyBodyFunctionExpression node (#12982) 2022-06-14 12:33:44 +08:00
Sosuke Suzuki 2316e2fecd Update linguist-language (#12994)
* Install new `linguist-language`

* Remove `.mts` and `.cts`

* Update tests
2022-06-12 01:55:11 +09:00
Sosuke SuzukiandSimon Lydell fdccc0f48e Add --cache CLI option (#12800)
* Install `file-entry-cache` and types

* Implement `FormatResultsCache`

* Add `--cache` and `--cache-location` option

* Implement `--cache` and `--cache-location`

* Add tests for `--cache`

* Add tests for `--cache-location`

* Avoid spellcheck error

* Update snapshots for new options

* Add `groupBy` for website

* Use `fs.promises` instead of `fs/promises`

* Use `rimraf` instead of `fs.rm`

* Fix properties order of `options`

* Install `find-cache-dir` and types

* Change default cache file location to `node_modules/.cache/prettier`

* Fix tests following to change default cache file location

* Update snapshots for changing default cache file location

* Set `os.tmpdir()` as a fallback for default cache dir

* Add docs for `--cache` and `--cache-location`

* Use `sdbm` instead of `node:crypto`

* Add changelog

* Fix `getHashOfOptions`

* Remove `cache-location`

* `prettiercache` -> `prettier-cache`

* Remove cache file when run Prettier without `--cache` option

* Implement `--cache-strategy`

* Add tests for invalid cache strategy

* Fix lint problems

* Tweaks tests

* Add tests for timestamp

* Add tests for `--cache-strategy`

* Add docs for cache-strategy

* Address review

* Fix `findCacheFile`

* Use Set.prototype.has

* Throw error with --stdin-filepath

* Update snapshots

* Fix error for cache and stdin

* Use string constructor instead of toString

* Update changelog

* Use flag validation

* Fix `cache-strategy` definition

* Update docs

* Mark highlihgt

* Throw error for `--cache-strategy` without `--cache`

* Update docs

* Fix typo

* Updates snapshots

* Update docs/cli.md

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>

* Fix error message

* Remove `:::` syntax

* Defaults `content`

* Update docs

* Fix by Prettier

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
2022-06-11 23:32:32 +09:00
Sosuke Suzuki 97bab8f984 Update angular-estree-parser (#12993)
* Update `angular-estree-parser`

* Add tests

* Add changelog
2022-06-11 20:08:46 +09:00
Sosuke Suzuki 7f9a08762d Update dependency flow-parser to v0.180.0 (#12990)
* Update `flow-parser`

* Update snapshots
2022-06-11 00:06:22 +09:00
Sosuke Suzuki be9d63e543 Avoid printing attribute per line in Vue SFC blocks (#12895)
* Avoid print single attribute perline for Vue SFC blocks

* Add tests

* Add changelog

* Fix typo

* Add more tests
2022-06-04 23:25:27 +09:00
Sosuke Suzuki a808df643d Update @typescript-eslint/typescript-estree to 5.27.0 and move tests (#12959)
* Install latest typescript-estree

* Move tests for type parameter of typeof

* Update changelog
2022-06-01 06:47:51 +09:00
Sosuke Suzuki 9c11aa141a Add tests for TS 4.7 features (#12924)
* Add tests for instantiation expressions

* Add tests for infer extends

* Add tests for optional variance

* Update changelog
2022-05-28 03:37:30 +09:00
HosokawaR a089819223 fix formatting for typescript Enum with computed members (#12930)
* fix formatting for typescript Enum with computed members

* add change log

* remove extra examples in change log
2022-05-27 20:44:17 +09:00
Sosuke Suzuki 3147244f55 Update dependencies to support TypeScript 4.7 (#12921)
* Update `@typescript-eslint/typescript-estree` to 5.26.0

* Update `typescript` to `4.7.1-rc`

* Fix syntax kind

* Add `jsdoc_only_types.ts` to unstable tests

* Make printing jsdoc type stable

* Update typescript
2022-05-27 01:46:31 +09:00
Sosuke Suzuki 2fc6e5dd4f Support TS 4.7 optional variance (#12900)
* Print `in` and `out`

* Add tests

* Add tests for jsx
2022-05-22 03:33:05 +09:00
Sosuke Suzuki 1eecc85985 Support TS 4.7 instantiation expression (#12898)
* Handle `TSInstantiationExpression`

* Print `typeParameters` for `TSTypeQuery`

* Add tests

* Add more tests
2022-05-22 03:30:47 +09:00
Sosuke Suzuki bc6539c15c Add tests for extends constraints for infer (#12897) 2022-05-22 03:28:47 +09:00
Sosuke Suzuki 36c20c51bc Support Speculation Rules API formatting in HTML (#12882)
* Add script formatting for `speculationrules`

* Fix lint problems
2022-05-17 10:38:46 +09:00
Jed Fox de16657ba0 Remove all references to Gitter (#12885) 2022-05-16 11:08:44 -04:00
HosokawaR 765d78305f Fix exports comment formats. (#12860)
* fix exports comment formats

* add tests

* add change log

* rename function name

* merge logic

* add tests to compare comment formats in `export` and `import`
2022-05-15 22:39:55 +09:00
HosokawaRandfisker Cheung 7ab6198453 Make more callee patterns recognized as "test call callee". (#12779)
* make more pattern recognized as test call callee

* add tests

* add change log

* make collate logic easier to read.

* add typedef

* remove extra processing

* fix filename mistake is-noded-matches.js -> is-node-matches.js

* add correct words to cspell config

* add a comment about copying

* move patterns outside

* Minor tweak

* rename valiable name

* Adding changelog real-world use case

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-05-07 16:44:56 +09:00
053022f5ed Infer Stylus parser in Vue SFC (#12707)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-05-01 23:01:24 +08:00
Sosuke Suzuki fe6820e815 Try to fix pnpm error on Dev Package Tests (#12774)
* Remove `-y` from `pnpm init`

* Change
2022-05-01 11:49:15 +09:00
Sosuke Suzuki 504d751036 Preserve blank line between export specifiers (#12746)
* Preserve blank line between export specifiers

* Add changelog

* rename
2022-04-29 17:42:42 +09:00
fisker Cheung fc74af1d94 Set loglevel to debug automatically when performance flags found (#12698) 2022-04-28 11:24:59 +08:00
HosokawaRandfisker Cheung 9fbdcda5b1 Print as instead of : for babel-ts parser (#12706)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-27 17:56:38 +08:00
fisker Cheung d1332b4c63 Set printBasicPrototype: false in snapshots (#12702) 2022-04-27 17:56:05 +08:00
fisker Cheung 85e6e4f73f CLI: Skip print code or write file when performance flags found (#12682) 2022-04-25 08:44:22 +08:00
29c4a3e559 bugfix(graphql): Fix single line and empty description formatting (#12608)
Co-authored-by: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-22 20:38:44 +08:00
Sosuke Suzuki a4cba80dc0 Allow formatting for Vue template expression written in TypeScript (#12584)
* Support TS expression in vue SFC

* Add changelog

* Add `__ts_expression`

* Add `__vue_ts_expression`

* Add tests

* Do not use `ast.walk`

* Address review

* Add `__vue_ts_event_binding`

* Fix
2022-04-17 13:12:19 +09:00
Sosuke Suzukiandfisker Cheung fa3b95c2e1 Remove lodash (#12628)
* Replace `groupBy`

* Replace `partition`

* Replace `pick`

* Move `partition`

* Replace `uniqBy`

* Replace `fromPairs`

* Remove usage from website

* Reuse `partition`

* Remove from package.json

* Fix

* Use `ignore.default`

* Add `resolveConfig` to `FileInfoOptions`

* Explicit tuple types

* Make `cache` optional

* Fix cosmiconfig type

* Use `@ts-expect-error` for private property access

* Add type annotation for validate

* Fix type errors for `OptionInfo`

* Add `@ts-expect-error`

* Fix type of `normalizeOptions`

* Fix `OptionInfo` type

* Add `@ts-expect-error` for `option-normalizer`

* Avoid type error

* Fix typo

* Add types for lodash fns

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-10 15:26:07 +09:00
Simen Bekkhus 033ac94f25 chore: disable string escaping in snapshots (#12612) 2022-04-08 09:59:17 +09:00