27 Commits
Author SHA1 Message Date
fisker Cheung 165423ceb3 Fix linting failure on main branch (#19481) 2026-06-27 18:08:26 +08:00
Konv Suu fe040aeef9 Fix cache not invalidated when files are ignored or restored (#18029) 2026-06-27 17:45:39 +08:00
Paulo Duarte 9c044f33a8 fix: match useCheckSum casing expected by file-entry-cache v11 (#18914) 2026-04-12 07:41:41 +08:00
fisker Cheung b5a3bf3d6e Enable jest/prefer-strict-equal rule (#18714) 2026-01-22 23:53:24 +08:00
fisker Cheung c9eb4bcd9e Remove useless u flags in regular expressions (#18509) 2025-12-21 23:44:08 +08:00
Chiawen Chenandfisker Cheung 0273e33fc6 Avoid creating node_modules/.cache/ when --cache is not enabled (#18124)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2025-11-17 03:05:45 +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
renovate[bot] 36460be18f chore(deps): update dependency file-entry-cache to v10 (#16725) 2025-01-17 23:48:00 +08:00
fisker Cheung c03a12ad2b Enable require-unicode-regexp and regexp/strict rule (#16408) 2024-06-18 07:52:54 +09:00
Alexander Kachkaev 1ea2fd059a Add eslint-plugin-simple-import-sort (#15817) 2023-12-18 03:34:12 +08:00
fisker Cheung b15d287f81 Update Jest to v30 (#15580) 2023-11-27 23:25:58 +08:00
ADTC 7e67e43061 Show (unchanged) keyword for accessibility in CLI --write (#15467) 2023-10-09 08:40:28 +09:00
fisker Cheung 98ae581402 Minor tweak to CLI (#15366) 2023-09-07 16:32:43 +08:00
Sosuke Suzuki fa48415617 Bump Prettier dependency to 3.0.0 2023-07-05 21:50:05 +09:00
fisker Cheung b86e42cc84 Ignore .gitignored files (#14731) 2023-05-04 17:20:05 +08:00
fisker Cheung fb948bb15f Integration test: Rename runPrettier to runCli (#14687) 2023-04-11 08:44:23 +08:00
fisker Cheung 1d4f243d72 Ignore/generate files during --cache test (#14629) 2023-04-03 16:10:40 +08:00
fisker Cheung df7771caf5 CLI: Use absolute path internally (#14632) 2023-03-31 09:04:33 +08:00
Sosuke Suzuki bb04cf072e Merge branch 'main' into next 2022-10-25 01:42:41 +09: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
Sosuke Suzuki d09bc86c9f Enable prettier-internal-rules/prefer-fs-promises-submodule for all files (#13722)
* Enable `prefer-fs-promises-submodule` for all files

* Fix problems
2022-10-23 22:23:44 +09:00
Sosuke Suzuki f8773fcd6a Remove rimraf package (#13721)
* Remove `rimraf` from `draft-blog-post`

* Remove `rimraf` from `sync-flow-tests`

* Remove `rimraf` from cache tests

* Uninstall `rimraf`
2022-10-23 22:23:30 +09:00
fisker Cheung 55779bb96c Refactor CLI tests (#13208) 2022-08-03 14:19:00 +08: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
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 21f2ea0f1e Fix 2022-06-19 11:28:28 +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