Commit Graph
44 Commits
Author SHA1 Message Date
Junseong Park 2821d097e6 Docs: update cli commands (#17172) 2025-02-26 11:28:26 +09:00
Lehoczky Zoltánandfisker Cheung 6a612520bc Migrate from Docusaurus 1 to Docusaurus 3 (#17043)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2025-01-30 10:16:21 +08:00
Matt d'Entremont 4aebc0ecc8 Add "--write" to the prettier failure output (#16062) 2024-02-14 09:16:13 +00:00
Risu a5a556ff60 docs: Add .gitignore to the default ignore path (#15039)
docs: Add .gitignore to the default ignore path
2023-07-16 13:58:35 +09: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
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
fisker Cheung 578f093d30 Accept multiple --ignore-paths (#14332) 2023-04-10 10:51:46 +08:00
Mark Avery 284cdf4c3d Style: updated failure message to be more formal (#11369) 2022-10-25 12:26:41 +03:00
fisker Cheung 822f354ceb Update docs (#13309) 2022-09-26 19:28:43 +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
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
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
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 CheungandAlexander Kachkaev 3ba48bb266 Add --no-plugin-search (#10274)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2022-02-18 16:36:53 +08:00
Zearin 387fce4ed8 Minor formatting tweaks (#10807) 2021-05-06 16:55:23 +03:00
Georgii Dolzhykov 33ab1fccc8 Clarify docs about pragma (#10500) 2021-03-10 03:40:15 +02:00
Daron McIntosh 3d9f102301 Add CLI option to prevent errors on unmatched patterns (#10058) 2021-01-28 00:30:16 +02:00
e3d1f0dee0 CLI: Add --ignore-unknown (#8829)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2020-08-21 09:11:59 +08:00
fisker Cheung 466d4638b4 CLI: Add -w alias for --write option (#8833) 2020-07-27 10:10:01 +08:00
Anders Kaseorg bd679a7625 Bump loglevel of issues reported by --check to warn (#8703)
When prettier --check is run by a script that combines the output from
dozens of separate linters, any progress output like “Checking
formatting...” and “All matched files use Prettier code style!” is
just noise that makes it harder to see whether there are real
errors. Bump the loglevel of issues reported by --check from log to
warn so that the noise can be selectively silenced with
--loglevel=warn.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-07-14 22:13:51 +08:00
554b15473d Document recommended setup and improve docs overall (#8510)
Co-authored-by: Jed Fox <git@twopointzero.us>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-06-28 09:47:29 +08:00
fisker Cheung 096c28f080 Fix docs code style (#7937) 2020-04-03 18:44:03 +08:00
Georgii Dolzhykov 3f1c46373a Expand directories in CLI (2020) (#7660) 2020-03-17 01:34:32 +02:00
fisker Cheung 647c041b57 Check pattern existence before glob (#7587) 2020-02-19 12:57:39 +02:00
Christian Boehlke 7537f21b1b docs: Fix broken links (#7222) 2020-01-05 18:37:26 +02:00
fisker Cheung 545a712dc0 Revert #6333 (#6721) 2019-11-02 09:47:16 +01:00
Evilebot Tnawi 6d4d6a7599 revert: --only-changed argument (#6594) 2019-10-03 11:21:05 -03:00
Niklas Higi 788bd7afcd Link to fast-glob instead of glob in docs (#6333) 2019-07-28 09:43:06 +03:00
Gabriel Harel 6fae09b67e Add --only-changed flag to CLI (#5910) 2019-07-22 11:17:24 -03:00
James George ed15b6d04e Add exit code information to cli docs (#6049)
* Update docs 👍

Add information regarding exit codes to the cli docs

* Markdown fix 🚧

Docs linting fixes

* Remove extraneous whitespace
2019-04-16 07:40:11 -04:00
Jimmy Gaussen a8d423b18c docs: remove redundant "./" from relative links (#5741)
Fixes #5740

fixed with `sed -i "s#(\./#(#" docs/*.md website/versioned_docs/version-stable/*.md`
2019-01-10 12:06:41 -02:00
Alexander Kachkaev a18d80253a Restore --check option docs (#5674) 2018-12-25 16:01:02 +08:00
Alexander Kachkaev 439b1649ff Temporary remove --check docs until 1.16 is released to avoid confusion (#5671)
Context: https://github.com/prettier/prettier/pull/5629#issuecomment-448933238
2018-12-21 06:27:17 -05:00
Alexander Kachkaev 711c6d78a8 Add --check option (#5629) 2018-12-19 22:03:30 +08:00
Lucas Duailibe c10c0e3dae Fix docs lint 2018-06-28 16:25:56 -03:00
Derek Kramer 0ce40b197d Add --stdin-filepath to website (#4513) 2018-06-28 20:38:16 +02:00
Lucas Duailibe 412b064df8 Format docs with Prettier 1.13 2018-05-27 15:38:31 -03:00
Lucas Azzola ed80d6c5bd Make all CLI logging go through a logger (#3515)
* Make all CLI logging go through a logger

* Add --loglevel docs

* Change default loglevel to log

* Update snapshots

* Switch to YAML eslint files
2017-12-18 23:22:07 +11:00
Roger Sheen 5065608f73 Docs: Add info on ignore file to "Ignoring Code" (#3458)
* docs(ignore): mention ignore file in Ignoring Code

While working on #3321, I needed to ignore an entire file, but the "Ignoring Code" section of the docs only describes how to ignore blocks of code, so I wasn't aware of the default ignore file.

(The `.prettierignore` file is mentioned in the CLI section, but easily overlooked there.)

This commit extends the introduction sentence of the "Ignoring Code" section and adds a new subsection to explain how to ignore files.

https://github.com/prettier/prettier/issues/3321#issuecomment-350072566

* docs(cli): fix nesting error in heading hierarchy

The `--ignore-path` option currently appears as a third-level subsection of `--find-config-path` and `--config`, but this looks like an error.

This commit promotes the `--ignore-path` heading to the same (H2) level as the other CLI options.
2017-12-11 22:23:06 -02:00
Joseph Frazier cecf0657a5 Re-add EditorConfig support (undo #3213) (#3255)
* Revert "Revert "Respect EditorConfig settings" (#3213)"

This reverts commit d2241fc0d5.

* Comment out EditorConfig docs

See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769

* editorconfig: Support `indent_size = 0`

See https://github.com/prettier/prettier/pull/2760#discussion_r137447715
and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7

* Revert "Comment out EditorConfig docs"

This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f.

* Mark EditorConfig functionality as v1.9.0+

See https://github.com/prettier/prettier/pull/3255#discussion_r150432508

* editorconfig: Upgrade editorconfig-to-prettier to 0.0.4

* editorconfig: Only enable for CLI, by default

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add tests confirming that editorconfig is ignored by default in the API

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add/fix CLI option parsing

* editorconfig: Move docs from configuration.md to options.md

* editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig`

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792

* editorconfig: Update test snapshots

* editorconfig: Remove unnecessary options parsing code

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560

* editorconfig: Move docs from options.md to api.md and cli.md

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979

* resolveConfig: return null if both .prettierrc and .editorconfig are missing

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613

* Don't add now-failing tests

The way these tests work, both `tests_integration/cli/config/.prettierrc`
and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`,
so the test wouldn't work even on master. Here's a way to confirm that:

```js
const path = require('path')
const assert = require('assert')
const prettier = require('./')

const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist'
console.log(prettier.resolveConfig.sync(file))
assert(prettier.resolveConfig.sync(file) === null)
```
2017-12-05 09:28:27 +11:00
Ika 76efb33e75 chore: setup markdown formatting (#3224)
* chore(deps): upgrade prettier to v1.8.2

* chore: setup lint-docs script

* docs: add `<!-- prettier-ignore -->`s

* docs: format docs

* Revert "docs: format docs"

This reverts commit 6dba903987dddc498cb589ca311905f25b6aee53.

* chore(prettierrc): set `--no-prose-wrap`

* docs: format docs

* Revert "docs: format docs"

This reverts commit 139bd744b6921916be8fac4fa3bab83bae5d12df.

* docs: tweak

* docs: format docs

* chore: rename .prettierrc

* chore: rename back to .prettierrc

* chore: split out third-party

* refactor: fix linting

* chore: do not split out third-party on website
2017-11-22 22:27:40 +11:00
Ika 9652ad75f8 docs(website): fix link (#3206) 2017-11-09 00:49:39 +08:00
Jamel Toms dc9d628874 Fix broken link to configuration page (#3205) 2017-11-09 00:43:30 +08:00
Lucas Azzola 71a5533c4e Move all docs to website (#3139)
* Sync README -> docs/options.md

* Sync README -> docs/*.md

* Misc fixups

* Remove markdown-toc

* Remove insert-pragma from ToC

* Never again!

* Move all docs to ./docs

* Remove yarn toc

* Fix inter-doc links

* Fix links in footer

* Clean up README.md

* Add basic description to README.md

* Use flat badges

* Move editor guides to website

* Improve prettier-ignore docs

* Fixup bad find/replace

* Add JSON to README

* Fix custom parser API link

* Fixup GitHub centering, add downloads badge

* Add 1.8 docs

* docs(website): mention markdown on homepage (#1)

* Add intro

* Add watching-files.md

* Fix markdown syntax highlighting

* Switch back to .md links
2017-11-07 14:39:07 +11:00