Commit Graph
41 Commits
Author SHA1 Message Date
fisker Cheung 05a5ff54d0 Add failed test back (#17384) 2025-04-22 17:17:47 +08:00
fisker Cheung 42346f2ef7 Run CLI test in child_process (#17382) 2025-04-21 18:58:44 +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 5dc7e8e54a Accept URL as custom config file in resolveConfig (#17167) 2025-02-25 08:46:15 +08: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
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
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
fisker Cheung 44949eb5dc Support absolute path in config file (#15666) 2023-12-13 16:16:15 +08: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
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
fisker Cheung 1a00467677 Fix error when formatting file names contains square brackets or dots (#15597) 2023-11-07 10:25:24 +08:00
SUZUKI Sosuke 9f06cdd5b0 Process files only supported by plugins (#15433) 2023-09-25 14:45:01 +09:00
fisker Cheung a35008fb0a Support shared config that forbids require() (#15233) 2023-08-29 16:11:43 +08:00
YimingIsCOLD fa43afcc67 Fix parsing jsx style element with spread attribute (#15095) 2023-07-16 13:33:13 +09:00
fisker Cheung c0f6f2da8b Clear filename before print ignored file code to screen (#14794) 2023-05-16 20:40:18 +08:00
fisker CheungandSUZUKI Sosuke 54404fc96f Remove plugin search feature (#14759)
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2023-05-05 10:31:25 +08:00
fisker Cheung b86e42cc84 Ignore .gitignored files (#14731) 2023-05-04 17:20:05 +08:00
Anders Kaseorgandfisker dcc081db0d Don’t expand globs via symbolic links (#14627)
Co-authored-by: fisker <lionkay@gmail.com>
2023-05-04 17:01:20 +08:00
SUZUKI Sosuke f624507259 Print line breaking after file path with errors (#14788) 2023-05-04 17:51:14 +09:00
fisker Cheung 1d4f243d72 Ignore/generate files during --cache test (#14629) 2023-04-03 16:10:40 +08:00
fisker Cheung d883834963 Test invalid TOML config (#14583) 2023-03-24 16:30:56 +08:00
Sosuke Suzuki b12396d69a Change --loglevel to --log-level (#13204)
* Change `--loglevel` to `--log-level`

* Update tests

* Update docs

* Add changelog
2022-08-02 09:39:41 +09:00
fisker Cheung 298347c9fb Merge branch 'main' into next
# Conflicts:
#	netlify.toml
#	src/cli/find-cache-file.js
#	src/cli/utils.js
#	src/main/parser.js
#	website/playground/PrettierFormat.js
#	website/static/worker.js
2022-08-01 11:27:34 +08:00
fisker Cheung 44d246a2a2 Support config file in ESM (#13130) 2022-08-01 10:51:31 +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
fisker Cheung 6a1d1d093b Rewrite config resolution tests (#13146) 2022-07-21 15:21:59 +08:00
fisker 0e0f879c1a Merge branch 'main' into next
# Conflicts:
#	docs/browser.md
#	package.json
#	scripts/release/yarn.lock
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/cli/expand-patterns.js
#	src/cli/format.js
#	src/cli/utils.js
#	src/language-js/index.js
#	src/language-js/parse/postprocess/index.js
#	src/language-js/parse/postprocess/typescript.js
#	tests/format/misc/errors/invalid/jsfmt.spec.js
#	tests/integration/__tests__/__snapshots__/support-info.js.snap
#	website/playground/sidebar/SidebarOptions.js
#	yarn.lock
2022-06-19 11:12:22 +08: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
fisker Cheung a85f38f096 Merge branch 'main' into next
# Conflicts:
#	.github/workflows/dev-test.yml
#	jest.config.mjs
#	package.json
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/cli/format.js
#	src/cli/options/create-minimist-options.js
#	src/cli/options/parse-cli-arguments.js
#	src/cli/usage.js
#	src/cli/utils.js
#	src/common/create-ignorer.js
#	src/common/load-plugins.js
#	src/config/resolve-config.js
#	src/index.js
#	src/language-css/utils/css-units.evaluate.js
#	src/language-html/ast.js
#	src/language-html/print-preprocess.js
#	src/language-html/utils/index.js
#	src/main/multiparser.js
#	tests/format/markdown/auto-link/jsfmt.spec.js
#	tests/integration/__tests__/__snapshots__/config-resolution.js.snap
#	tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap
#	tests/integration/__tests__/file-info.js
#	yarn.lock
2022-04-25 14:28:27 +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
Harry Hopkinsonandfisker Cheung f98c197b66 Print the number of files that need formatting. (#12561)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-07 09:47:13 +08:00
fisker Cheung 52c9a20e2c Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/cli/index.js
#	tests/config/install-prettier.js
#	tests/format/yaml/block-literal/jsfmt.spec.js
#	tests/integration/__tests__/file-info.js
#	yarn.lock
2022-02-21 16:12:59 +08:00
fisker CheungandAlexander Kachkaev 3ba48bb266 Add --no-plugin-search (#10274)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2022-02-18 16:36:53 +08:00
fisker Cheung 5028086e07 Refactor integration test files to use ES Module (part 2) (#11912) 2021-12-03 15:41:12 +08:00
fisker Cheung 776b3ff13d Recognize zx interpreter (#11238) 2021-07-22 09:44:42 +08:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00