From 576b2a75075308c92a9efbea5eea96f9c4af83fd Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 13 Feb 2025 22:14:24 +0900 Subject: [PATCH 01/35] Bump Prettier dependency to 3.5.1 --- package.json | 4 ++-- yarn.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 1f3f49f98e20..737a0f5c40af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "3.5.1", + "version": "3.6.0-dev", "description": "Prettier is an opinionated code formatter", "bin": "./bin/prettier.cjs", "repository": "prettier/prettier", @@ -146,7 +146,7 @@ "magic-string": "0.30.17", "node-style-text": "0.0.7", "npm-run-all2": "7.0.2", - "prettier": "3.5.0", + "prettier": "3.5.1", "pretty-bytes": "6.1.1", "rollup-plugin-license": "3.5.3", "semver": "7.7.1", diff --git a/yarn.lock b/yarn.lock index c302aebdf52b..b8b4bea4c075 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7462,12 +7462,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.5.0": - version: 3.5.0 - resolution: "prettier@npm:3.5.0" +"prettier@npm:3.5.1": + version: 3.5.1 + resolution: "prettier@npm:3.5.1" bin: prettier: bin/prettier.cjs - checksum: 10/fc26c74bd317282f2a49ffe3ac0ffa79adbe6b2d7a1cdcadd96acf7fec77d3fa45b15f3728c1a2f281f4beccb35d97207187452a581d4919d18b460d0c37e480 + checksum: 10/09ab168e651e50c2c79804d65f17a68129ce1c573830b2fb08c988b585add8076b8d995789034d66a14338d6b8835e8c591e0fc1bc90f4344af9645738636d01 languageName: node linkType: hard @@ -7573,7 +7573,7 @@ __metadata: postcss-scss: "npm:4.0.9" postcss-selector-parser: "npm:2.2.3" postcss-values-parser: "npm:2.0.1" - prettier: "npm:3.5.0" + prettier: "npm:3.5.1" pretty-bytes: "npm:6.1.1" regexp-util: "npm:2.0.0" remark-footnotes: "npm:2.0.0" From 3e5456fcf6eae80b5532d92b6d19326d3cdfe1bf Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 13 Feb 2025 22:14:28 +0900 Subject: [PATCH 02/35] Clean changelog_unreleased --- changelog_unreleased/cli/17100.md | 3 --- changelog_unreleased/yaml/17101.md | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 changelog_unreleased/cli/17100.md delete mode 100644 changelog_unreleased/yaml/17101.md diff --git a/changelog_unreleased/cli/17100.md b/changelog_unreleased/cli/17100.md deleted file mode 100644 index 3c720fc8ce7d..000000000000 --- a/changelog_unreleased/cli/17100.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Fix CLI crash when cache for old version exists (#17100 by @sosukesuzuki) - -Prettier 3.5 uses a different cache format than previous versions, Prettier stable crashes when reading existing cache file, Prettier main fixed the problem. diff --git a/changelog_unreleased/yaml/17101.md b/changelog_unreleased/yaml/17101.md deleted file mode 100644 index f8d4a8482679..000000000000 --- a/changelog_unreleased/yaml/17101.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Support dockercompose and github-actions-workflow in VSCode (#17101 by @remcohaszing) - -Prettier now supports the `dockercompose` and `github-actions-workflow` languages in Visual Studio Code. From bc6a8b410612a3463791e853cdcd61faa342b86d Mon Sep 17 00:00:00 2001 From: SUZUKI Sosuke Date: Fri, 14 Feb 2025 02:18:13 +0900 Subject: [PATCH 03/35] Update page path in release script (#17109) --- scripts/release/steps/update-dependents-count.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/release/steps/update-dependents-count.js b/scripts/release/steps/update-dependents-count.js index 2e1909304713..e24137dd2a18 100644 --- a/scripts/release/steps/update-dependents-count.js +++ b/scripts/release/steps/update-dependents-count.js @@ -33,7 +33,7 @@ async function update() { ); } - processFile("website/pages/en/index.js", (content) => + processFile("website/src/pages/index.jsx", (content) => content .replace( /()(.*?)(<\/strong>)/u, @@ -49,7 +49,7 @@ async function update() { "Checking if dependents count has been updated", async () => (await runGit(["diff", "--name-only"])).stdout === - "website/pages/en/index.js", + "website/src/pages/index.jsx", ); if (isUpdated) { From 7044fbe8272a2bae8562b793ad2c96932207690f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 12:03:49 +0800 Subject: [PATCH 04/35] chore(deps): update babel to v7.26.9 (#17112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- website/package.json | 4 +- website/yarn.lock | 122 ++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 67 deletions(-) diff --git a/website/package.json b/website/package.json index 563e61a22e21..7362c4b03987 100644 --- a/website/package.json +++ b/website/package.json @@ -30,8 +30,8 @@ "react-tweet": "3.2.1" }, "devDependencies": { - "@babel/core": "7.26.8", - "@babel/preset-env": "7.26.8", + "@babel/core": "7.26.9", + "@babel/preset-env": "7.26.9", "@docusaurus/module-type-aliases": "3.7.0", "@docusaurus/types": "3.7.0", "@types/js-yaml": "4.0.9", diff --git a/website/yarn.lock b/website/yarn.lock index 951ca178d337..a042207c398e 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -225,40 +225,39 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.26.8, @babel/core@npm:^7.21.3, @babel/core@npm:^7.25.9": - version: 7.26.8 - resolution: "@babel/core@npm:7.26.8" +"@babel/core@npm:7.26.9, @babel/core@npm:^7.21.3, @babel/core@npm:^7.25.9": + version: 7.26.9 + resolution: "@babel/core@npm:7.26.9" dependencies: "@ampproject/remapping": "npm:^2.2.0" "@babel/code-frame": "npm:^7.26.2" - "@babel/generator": "npm:^7.26.8" + "@babel/generator": "npm:^7.26.9" "@babel/helper-compilation-targets": "npm:^7.26.5" "@babel/helper-module-transforms": "npm:^7.26.0" - "@babel/helpers": "npm:^7.26.7" - "@babel/parser": "npm:^7.26.8" - "@babel/template": "npm:^7.26.8" - "@babel/traverse": "npm:^7.26.8" - "@babel/types": "npm:^7.26.8" - "@types/gensync": "npm:^1.0.0" + "@babel/helpers": "npm:^7.26.9" + "@babel/parser": "npm:^7.26.9" + "@babel/template": "npm:^7.26.9" + "@babel/traverse": "npm:^7.26.9" + "@babel/types": "npm:^7.26.9" convert-source-map: "npm:^2.0.0" debug: "npm:^4.1.0" gensync: "npm:^1.0.0-beta.2" json5: "npm:^2.2.3" semver: "npm:^6.3.1" - checksum: 10/a70d903dfd2c97e044b27fb480584fab6111954ced6987c6628ee4d37071ca446eca7830d72763a8d16a0da64eb83e02e3073d16c09e9eefa4a4ab38162636b4 + checksum: 10/ceed199dbe25f286a0a59a2ea7879aed37c1f3bb289375d061eda4752cab2ba365e7f9e969c7fd3b9b95c930493db6eeb5a6d6f017dd135fb5a4503449aad753 languageName: node linkType: hard -"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.8": - version: 7.26.8 - resolution: "@babel/generator@npm:7.26.8" +"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/generator@npm:7.26.9" dependencies: - "@babel/parser": "npm:^7.26.8" - "@babel/types": "npm:^7.26.8" + "@babel/parser": "npm:^7.26.9" + "@babel/types": "npm:^7.26.9" "@jridgewell/gen-mapping": "npm:^0.3.5" "@jridgewell/trace-mapping": "npm:^0.3.25" jsesc: "npm:^3.0.2" - checksum: 10/8c5af0f74aad2e575f2f833af0a9a38dda5abe0574752b5e0812677c78e5dc713b6b0c9ac3b30799ba6ef883614f9f0ef79d3aa10ba8f0e54f7f0284381b0059 + checksum: 10/95075dd6158a49efcc71d7f2c5d20194fcf245348de7723ca35e37cd5800587f1d4de2be6c4ba87b5f5fbb967c052543c109eaab14b43f6a73eb05ccd9a5bb44 languageName: node linkType: hard @@ -446,24 +445,24 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.26.7": - version: 7.26.7 - resolution: "@babel/helpers@npm:7.26.7" +"@babel/helpers@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/helpers@npm:7.26.9" dependencies: - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.26.7" - checksum: 10/97593a0c9b3c5e2e7cf824e549b5f6fa6dc739593ad93d5bb36d06883d8124beac63ee2154c9a514dbee68a169d5683ab463e0ac6713ad92fb4854cea35ed4d4 + "@babel/template": "npm:^7.26.9" + "@babel/types": "npm:^7.26.9" + checksum: 10/267dfa7d04dff7720610497f466aa7b60652b7ec8dde5914527879350c9d655271e892117c5b2f0f083d92d2a8e5e2cf9832d4f98cd7fb72d78f796002af19a1 languageName: node linkType: hard -"@babel/parser@npm:^7.26.8": - version: 7.26.8 - resolution: "@babel/parser@npm:7.26.8" +"@babel/parser@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/parser@npm:7.26.9" dependencies: - "@babel/types": "npm:^7.26.8" + "@babel/types": "npm:^7.26.9" bin: parser: ./bin/babel-parser.js - checksum: 10/0dd9d6b2022806b696b7a9ffb50b147f13525c497663d758a95adcc3ca0fa1d1bbb605fcc0604acc1cade60c3dbf2c1e0dd22b7aed17f8ad1c58c954208ffe7a + checksum: 10/cb84fe3ba556d6a4360f3373cf7eb0901c46608c8d77330cc1ca021d60f5d6ebb4056a8e7f9dd0ef231923ef1fe69c87b11ce9e160d2252e089a20232a2b942b languageName: node linkType: hard @@ -792,15 +791,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-for-of@npm:7.25.9" +"@babel/plugin-transform-for-of@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/plugin-transform-for-of@npm:7.26.9" dependencies: - "@babel/helper-plugin-utils": "npm:^7.25.9" + "@babel/helper-plugin-utils": "npm:^7.26.5" "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.9" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10/63a2db7fe06c2e3f5fc1926f478dac66a5f7b3eaeb4a0ffae577e6f3cb3d822cb1ed2ed3798f70f5cb1aa06bc2ad8bcd1f557342f5c425fd83c37a8fc1cfd2ba + checksum: 10/25df1ea3bcecc1bcef99f273fbd8f4a73a509ab7ef3db93629817cb02f9d24868ca3760347f864c8fa4ab79ffa86fb09b2f2de1f2ba1f73f27dbe0c3973c6868 languageName: node linkType: hard @@ -1280,9 +1279,9 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:7.26.8, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.25.9": - version: 7.26.8 - resolution: "@babel/preset-env@npm:7.26.8" +"@babel/preset-env@npm:7.26.9, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.25.9": + version: 7.26.9 + resolution: "@babel/preset-env@npm:7.26.9" dependencies: "@babel/compat-data": "npm:^7.26.8" "@babel/helper-compilation-targets": "npm:^7.26.5" @@ -1313,7 +1312,7 @@ __metadata: "@babel/plugin-transform-dynamic-import": "npm:^7.25.9" "@babel/plugin-transform-exponentiation-operator": "npm:^7.26.3" "@babel/plugin-transform-export-namespace-from": "npm:^7.25.9" - "@babel/plugin-transform-for-of": "npm:^7.25.9" + "@babel/plugin-transform-for-of": "npm:^7.26.9" "@babel/plugin-transform-function-name": "npm:^7.25.9" "@babel/plugin-transform-json-strings": "npm:^7.25.9" "@babel/plugin-transform-literals": "npm:^7.25.9" @@ -1355,7 +1354,7 @@ __metadata: semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10/0f2b5c252b6ee1298f3a3f28ae6a85551cf062b2397cf4f2b11d5235c7bba58b8db2aa651ea42f7642f7c79024684a40da0f53035c820afa03bc37850bc28cbf + checksum: 10/ac6fad331760c0bc25ed428b7696b297bad7046a75f30e544b392acfb33709f12316b9a5b0c8606f933d5756e1b9d527b46fda09693db52e851325443dd6a574 languageName: node linkType: hard @@ -1422,39 +1421,39 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.25.9, @babel/template@npm:^7.26.8": - version: 7.26.8 - resolution: "@babel/template@npm:7.26.8" +"@babel/template@npm:^7.25.9, @babel/template@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/template@npm:7.26.9" dependencies: "@babel/code-frame": "npm:^7.26.2" - "@babel/parser": "npm:^7.26.8" - "@babel/types": "npm:^7.26.8" - checksum: 10/bc45db0fd4e92d35813c2a8e8fa80b8a887c275b323537b8ebd9c64228c1614e81c74236d08f744017a6562987e48b10501688f7a8be5d6a53fb6acb61aa01c8 + "@babel/parser": "npm:^7.26.9" + "@babel/types": "npm:^7.26.9" + checksum: 10/240288cebac95b1cc1cb045ad143365643da0470e905e11731e63280e43480785bd259924f4aea83898ef68e9fa7c176f5f2d1e8b0a059b27966e8ca0b41a1b6 languageName: node linkType: hard -"@babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.26.8": - version: 7.26.8 - resolution: "@babel/traverse@npm:7.26.8" +"@babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.26.8, @babel/traverse@npm:^7.26.9": + version: 7.26.9 + resolution: "@babel/traverse@npm:7.26.9" dependencies: "@babel/code-frame": "npm:^7.26.2" - "@babel/generator": "npm:^7.26.8" - "@babel/parser": "npm:^7.26.8" - "@babel/template": "npm:^7.26.8" - "@babel/types": "npm:^7.26.8" + "@babel/generator": "npm:^7.26.9" + "@babel/parser": "npm:^7.26.9" + "@babel/template": "npm:^7.26.9" + "@babel/types": "npm:^7.26.9" debug: "npm:^4.3.1" globals: "npm:^11.1.0" - checksum: 10/2785718e54d7a243a4c1b92fe9c2cec0d3b8725b095061b8fdb9812bbcf1b94b743b39d96312644efa05692f9c2646772a8154c89625f428aa6b568cebf4ecf9 + checksum: 10/c16a79522eafa0a7e40eb556bf1e8a3d50dbb0ff943a80f2c06cee2ec7ff87baa0c5d040a5cff574d9bcb3bed05e7d8c6f13b238a931c97267674b02c6cf45b4 languageName: node linkType: hard -"@babel/types@npm:^7.21.3, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.7, @babel/types@npm:^7.26.8, @babel/types@npm:^7.4.4": - version: 7.26.8 - resolution: "@babel/types@npm:7.26.8" +"@babel/types@npm:^7.21.3, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.9, @babel/types@npm:^7.4.4": + version: 7.26.9 + resolution: "@babel/types@npm:7.26.9" dependencies: "@babel/helper-string-parser": "npm:^7.25.9" "@babel/helper-validator-identifier": "npm:^7.25.9" - checksum: 10/e6889246889706ee5e605cbfe62657c829427e0ddef0e4d18679a0d989bdb23e700b5a851d84821c2bdce3ded9ae5b9285fe1028562201b28f816e3ade6c3d0d + checksum: 10/11b62ea7ed64ef7e39cc9b33852c1084064c3b970ae0eaa5db659241cfb776577d1e68cbff4de438bada885d3a827b52cc0f3746112d8e1bc672bb99a8eb5b56 languageName: node linkType: hard @@ -3220,13 +3219,6 @@ __metadata: languageName: node linkType: hard -"@types/gensync@npm:^1.0.0": - version: 1.0.4 - resolution: "@types/gensync@npm:1.0.4" - checksum: 10/99c3aa0d3f1198973c7e51bea5947b815f3338ce89ce09a39ac8abb41cd844c5b95189da254ea45e50a395fe25fd215664d8ca76c5438814963597afb01f686e - languageName: node - linkType: hard - "@types/gtag.js@npm:^0.0.12": version: 0.0.12 resolution: "@types/gtag.js@npm:0.0.12" @@ -11376,8 +11368,8 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@babel/core": "npm:7.26.8" - "@babel/preset-env": "npm:7.26.8" + "@babel/core": "npm:7.26.9" + "@babel/preset-env": "npm:7.26.9" "@docusaurus/core": "npm:3.7.0" "@docusaurus/module-type-aliases": "npm:3.7.0" "@docusaurus/preset-classic": "npm:3.7.0" From 64e7dab1fd7a40edc6b51b41472fdc8cc286d2a3 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 15 Feb 2025 12:18:09 +0800 Subject: [PATCH 05/35] Fix links to Prettier/Babel/Jest website (#17079) --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- docs/configuration.md | 4 +- docs/ignore.md | 2 +- docs/options.md | 4 +- src/index.d.ts | 4 +- src/main/multiparser.js | 2 +- src/standalone.d.ts | 2 +- .../__snapshots__/format.test.js.snap | 150 +++++++++--------- .../js/babel-plugins/async-generators.js | 2 +- .../js/babel-plugins/class-properties.js | 2 +- tests/format/js/babel-plugins/decorators.js | 2 +- .../format/js/babel-plugins/do-expressions.js | 2 +- .../format/js/babel-plugins/dynamic-import.js | 2 +- .../js/babel-plugins/export-default-from.js | 2 +- .../js/babel-plugins/export-namespace-from.js | 2 +- tests/format/js/babel-plugins/flow.js | 2 +- .../format/js/babel-plugins/function-bind.js | 2 +- .../format/js/babel-plugins/function-sent.js | 2 +- tests/format/js/babel-plugins/import-meta.js | 2 +- tests/format/js/babel-plugins/jsx.js | 2 +- .../logical-assignment-operators.js | 2 +- .../nullish-coalescing-operator.js | 2 +- .../js/babel-plugins/numeric-separator.js | 2 +- .../js/babel-plugins/object-rest-spread.js | 2 +- .../babel-plugins/optional-catch-binding.js | 2 +- .../js/babel-plugins/optional-chaining.js | 2 +- .../js/babel-plugins/partial-application.js | 2 +- .../babel-plugins/pipeline-operator-fsharp.js | 2 +- .../babel-plugins/pipeline-operator-hack.js | 2 +- .../pipeline-operator-minimal.js | 2 +- .../js/babel-plugins/private-methods.js | 2 +- .../js/babel-plugins/throw-expressions.js | 2 +- tests/format/js/babel-plugins/typescript.js | 2 +- tests/format/misc/errors/js/format.test.js | 2 +- .../__snapshots__/plugin-api-embed.js.snap | 2 +- website/README.md | 6 +- website/blog/2017-11-07-1.8.0.md | 6 +- website/blog/2018-01-10-1.10.0.md | 2 +- website/blog/2018-04-09-plugin-php-0.1.md | 2 +- website/blog/2018-04-11-1.12.0.md | 8 +- website/blog/2018-05-27-1.13.0.md | 8 +- website/blog/2018-07-29-1.14.0.md | 10 +- website/blog/2018-11-07-1.15.0.md | 2 +- website/blog/2019-01-20-1.16.0.md | 2 +- website/blog/2019-11-09-1.19.0.md | 4 +- website/blog/2020-03-21-2.0.0.md | 6 +- website/blog/2020-08-24-2.1.0.md | 6 +- website/blog/2020-12-11-plugin-ruby-1.0.md | 2 +- website/blog/2021-05-09-2.3.0.md | 14 +- website/blog/2021-09-09-2.4.0.md | 2 +- website/blog/2022-03-16-2.6.0.md | 8 +- website/blog/2022-06-14-2.7.0.md | 2 +- website/blog/2022-11-23-2.8.0.md | 2 +- website/blog/2023-07-05-3.0.0.md | 16 +- website/blog/2023-11-13-3.1.0.md | 2 +- website/blog/2023-11-30-cli-deep-dive.md | 4 +- website/blog/2024-01-12-3.2.0.md | 2 +- website/blog/2024-11-26-3.4.0.md | 8 +- website/blog/2025-02-09-3.5.0.md | 4 +- website/data/editors.yml | 2 +- website/data/languages.yml | 2 +- .../version-stable/configuration.md | 4 +- .../versioned_docs/version-stable/ignore.md | 2 +- .../versioned_docs/version-stable/options.md | 4 +- 67 files changed, 186 insertions(+), 186 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index abaa3fc7a6f1..2a2cbaa05fdf 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -16,7 +16,7 @@ BEFORE SUBMITTING AN ISSUE: 2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. This means we add options only in the case of strict technical necessity. - Find out more: https://prettier.io/docs/en/option-philosophy.html + Find out more: https://prettier.io/docs/option-philosophy Don't fill the form below manually! Let a program create a report for you: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e25b50c1316..96de8533fe2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3194,7 +3194,7 @@ export const getVehicleDescriptor = async ( - Config: Match dotfiles in config overrides ([#6194] by [@duailibe]) - When using [`overrides`](https://prettier.io/docs/en/configuration.html#configuration-overrides) in the config file, Prettier was not matching dotfiles (files that start with `.`). This was fixed in 1.18.1 + When using [`overrides`](https://prettier.io/docs/configuration#configuration-overrides) in the config file, Prettier was not matching dotfiles (files that start with `.`). This was fixed in 1.18.1 [#6190]: https://github.com/prettier/prettier/pull/6190 [#6194]: https://github.com/prettier/prettier/pull/6194 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1807222a280..c8db04091352 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ yarn test ## Tests -The tests use [Jest snapshots](https://facebook.github.io/jest/docs/en/snapshot-testing.html). You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR. +The tests use [Jest snapshots](https://jestjs.io/docs/snapshot-testing). You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR. Each test directory in `tests/format` has a `format.test.js` file that controls how exactly the rest of the files in the directory are used for tests. This file must contain one or more calls to the `runFormatTest` global function. For example, in directories with JavaScript formatting tests, `format.test.js` generally looks like this: diff --git a/README.md b/README.md index 90da72dd1fe2..ce24c9cc602c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@
- + Your favorite language? diff --git a/docs/configuration.md b/docs/configuration.md index f3258fabc028..d0ba417dce74 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -58,7 +58,7 @@ JS (ES Modules): // prettier.config.js, .prettierrc.js, prettier.config.mjs, or .prettierrc.mjs /** - * @see https://prettier.io/docs/en/configuration.html + * @see https://prettier.io/docs/configuration * @type {import("prettier").Config} */ const config = { @@ -77,7 +77,7 @@ JS (CommonJS): // prettier.config.js, .prettierrc.js, prettier.config.cjs, or .prettierrc.cjs /** - * @see https://prettier.io/docs/en/configuration.html + * @see https://prettier.io/docs/configuration * @type {import("prettier").Config} */ const config = { diff --git a/docs/ignore.md b/docs/ignore.md index 2634632c54e5..6ba181dde2ad 100644 --- a/docs/ignore.md +++ b/docs/ignore.md @@ -191,4 +191,4 @@ For one-off commands, when you want to exclude some files without adding them to prettier . "!**/*.{js,jsx,vue}" --write ``` -See [fast-glob](https://prettier.io/docs/en/cli.html#file-patterns) to learn more about advanced glob syntax. +See [fast-glob](https://prettier.io/docs/cli#file-patterns) to learn more about advanced glob syntax. diff --git a/docs/options.md b/docs/options.md index 26af94e6415f..113648163028 100644 --- a/docs/options.md +++ b/docs/options.md @@ -146,7 +146,7 @@ Print trailing commas wherever possible in multi-line comma-separated syntactic Valid options: -- `"all"` - Trailing commas wherever possible (including [function parameters and calls](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas#Trailing_commas_in_functions)). To run, JavaScript code formatted this way needs an engine that supports ES2017 (Node.js 8+ or a modern browser) or [downlevel compilation](https://babeljs.io/docs/en/index). This also enables trailing commas in type parameters in TypeScript (supported since TypeScript 2.7 released in January 2018). +- `"all"` - Trailing commas wherever possible (including [function parameters and calls](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas#Trailing_commas_in_functions)). To run, JavaScript code formatted this way needs an engine that supports ES2017 (Node.js 8+ or a modern browser) or [downlevel compilation](https://babeljs.io/docs/index). This also enables trailing commas in type parameters in TypeScript (supported since TypeScript 2.7 released in January 2018). - `"es5"` - Trailing commas where valid in ES5 (objects, arrays, etc.). Trailing commas in type parameters in TypeScript and Flow. - `"none"` - No trailing commas. @@ -314,7 +314,7 @@ Valid options: - `"css"` (via [postcss](https://github.com/postcss/postcss)) _First available in v1.7.1_ - `"scss"` (via [postcss-scss](https://github.com/postcss/postcss-scss)) _First available in v1.7.1_ - `"less"` (via [postcss-less](https://github.com/shellscape/postcss-less)) _First available in v1.7.1_ -- `"json"` (via [@babel/parser parseExpression](https://babeljs.io/docs/en/next/babel-parser.html#babelparserparseexpressioncode-options)) _First available in v1.5.0_ +- `"json"` (via [@babel/parser parseExpression](https://babeljs.io/docs/babel-parser#babelparserparseexpressioncode-options)) _First available in v1.5.0_ - `"json5"` (same parser as `"json"`, but outputs as [json5](https://json5.org/)) _First available in v1.13.0_ - `"jsonc"` (same parser as `"json"`, but outputs as "JSON with Comments") _First available in v3.2.0_ - `"json-stringify"` (same parser as `"json"`, but outputs like `JSON.stringify`) _First available in v1.13.0_ diff --git a/src/index.d.ts b/src/index.d.ts index 87b4f2588786..c3e43e54f183 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -578,7 +578,7 @@ export interface CursorResult { } /** - * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/en/options.html) may be provided to override the defaults. + * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults. */ export function format(source: string, options?: Options): Promise; @@ -627,7 +627,7 @@ export interface ResolveConfigOptions { * * A promise is returned which will resolve to: * - * - An options object, providing a [config file](https://prettier.io/docs/en/configuration.html) was found. + * - An options object, providing a [config file](https://prettier.io/docs/configuration) was found. * - `null`, if no file was found. * * The promise will be rejected if there was an error parsing the configuration file. diff --git a/src/main/multiparser.js b/src/main/multiparser.js index 34cb1a217cc8..47fc2472254b 100644 --- a/src/main/multiparser.js +++ b/src/main/multiparser.js @@ -27,7 +27,7 @@ async function printEmbeddedLanguages( if (embed.length > 2) { throw new Error( - "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed", + "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed", ); } diff --git a/src/standalone.d.ts b/src/standalone.d.ts index 953ccf49c40a..67945fa3239b 100644 --- a/src/standalone.d.ts +++ b/src/standalone.d.ts @@ -17,7 +17,7 @@ export function formatWithCursor( ): Promise; /** - * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/en/options.html) may be provided to override the defaults. + * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults. */ export function format(source: string, options?: Options): Promise; diff --git a/tests/format/js/babel-plugins/__snapshots__/format.test.js.snap b/tests/format/js/babel-plugins/__snapshots__/format.test.js.snap index e782597aa0b3..611091975452 100644 --- a/tests/format/js/babel-plugins/__snapshots__/format.test.js.snap +++ b/tests/format/js/babel-plugins/__snapshots__/format.test.js.snap @@ -46,7 +46,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions +// https://babeljs.io/docs/babel-plugin-proposal-async-generator-functions async function* agf() { await 1; @@ -54,7 +54,7 @@ async function* agf() { } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions +// https://babeljs.io/docs/babel-plugin-proposal-async-generator-functions async function* agf() { await 1; @@ -338,7 +338,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-class-properties +// https://babeljs.io/docs/babel-plugin-proposal-class-properties class Bork { //Property initializer syntax @@ -366,7 +366,7 @@ class Bork { console.log(Bork.staticFunction()); // > "babelIsCool" =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-class-properties +// https://babeljs.io/docs/babel-plugin-proposal-class-properties class Bork { //Property initializer syntax @@ -470,7 +470,7 @@ class C extends HTMLElement { exports[`decorators.js [acorn] format 1`] = ` "Unexpected character '@' (3:1) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-decorators + 1 | // https://babeljs.io/docs/babel-plugin-proposal-decorators 2 | > 3 | @annotation | ^ @@ -482,7 +482,7 @@ Cause: Unexpected character '@' (3:0)" exports[`decorators.js [espree] format 1`] = ` "Unexpected character '@' (3:1) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-decorators + 1 | // https://babeljs.io/docs/babel-plugin-proposal-decorators 2 | > 3 | @annotation | ^ @@ -498,7 +498,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-decorators +// https://babeljs.io/docs/babel-plugin-proposal-decorators @annotation class MyClass { } @@ -529,7 +529,7 @@ function enumerable(value) { } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-decorators +// https://babeljs.io/docs/babel-plugin-proposal-decorators @annotation class MyClass {} @@ -674,7 +674,7 @@ class Foo { exports[`do-expressions.js [acorn] format 1`] = ` "Unexpected token (3:9) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-do-expressions 2 | > 3 | let a = do { | ^ @@ -686,7 +686,7 @@ Cause: Unexpected token (3:8)" exports[`do-expressions.js [espree] format 1`] = ` "Unexpected token do (3:9) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-do-expressions 2 | > 3 | let a = do { | ^ @@ -698,7 +698,7 @@ Cause: Unexpected token do" exports[`do-expressions.js [meriyah] format 1`] = ` "Unexpected token: 'do' (3:9) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-do-expressions 2 | > 3 | let a = do { | ^^ @@ -714,7 +714,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions +// https://babeljs.io/docs/babel-plugin-proposal-do-expressions let a = do { if(x > 10) { @@ -727,7 +727,7 @@ let a = do { let a = x > 10 ? 'big' : 'small'; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions +// https://babeljs.io/docs/babel-plugin-proposal-do-expressions let a = do { if (x > 10) { @@ -748,7 +748,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-dynamic-import +// https://babeljs.io/docs/babel-plugin-syntax-dynamic-import // There is no example code on babel website @@ -758,7 +758,7 @@ import('./prettier.mjs').then(module => console.log(module)); import(prettier).then(module => console.log(module)); =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-dynamic-import +// https://babeljs.io/docs/babel-plugin-syntax-dynamic-import // There is no example code on babel website @@ -875,13 +875,13 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-export-default-from +// https://babeljs.io/docs/babel-plugin-proposal-export-default-from export v from 'mod'; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-export-default-from +// https://babeljs.io/docs/babel-plugin-proposal-export-default-from export v from "mod"; @@ -894,12 +894,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-export-namespace-from +// https://babeljs.io/docs/babel-plugin-proposal-export-namespace-from export * as ns from 'mod'; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-export-namespace-from +// https://babeljs.io/docs/babel-plugin-proposal-export-namespace-from export * as ns from "mod"; @@ -908,7 +908,7 @@ export * as ns from "mod"; exports[`flow.js [__babel_estree] format 1`] = ` "Unexpected token, expected "," (3:17) - 1 | // https://babeljs.io/docs/en/babel-preset-flow + 1 | // https://babeljs.io/docs/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ @@ -918,7 +918,7 @@ Cause: Unexpected token, expected "," (3:16)" exports[`flow.js [acorn] format 1`] = ` "Unexpected token (3:17) - 1 | // https://babeljs.io/docs/en/babel-preset-flow + 1 | // https://babeljs.io/docs/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ @@ -928,7 +928,7 @@ Cause: Unexpected token (3:16)" exports[`flow.js [babel] format 1`] = ` "Unexpected token, expected "," (3:17) - 1 | // https://babeljs.io/docs/en/babel-preset-flow + 1 | // https://babeljs.io/docs/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ @@ -942,12 +942,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-preset-flow +// https://babeljs.io/docs/babel-preset-flow function foo(one: any, two: number, three?): string {} =====================================output===================================== -// https://babeljs.io/docs/en/babel-preset-flow +// https://babeljs.io/docs/babel-preset-flow function foo(one: any, two: number, three?): string {} @@ -960,12 +960,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-preset-flow +// https://babeljs.io/docs/babel-preset-flow function foo(one: any, two: number, three?): string {} =====================================output===================================== -// https://babeljs.io/docs/en/babel-preset-flow +// https://babeljs.io/docs/babel-preset-flow function foo(one: any, two: number, three?): string {} @@ -974,7 +974,7 @@ function foo(one: any, two: number, three?): string {} exports[`flow.js [espree] format 1`] = ` "Unexpected token : (3:17) - 1 | // https://babeljs.io/docs/en/babel-preset-flow + 1 | // https://babeljs.io/docs/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ @@ -984,7 +984,7 @@ Cause: Unexpected token :" exports[`flow.js [meriyah] format 1`] = ` "Expected ')' (3:17) - 1 | // https://babeljs.io/docs/en/babel-preset-flow + 1 | // https://babeljs.io/docs/babel-preset-flow 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ @@ -994,7 +994,7 @@ Cause: [3:16-3:17]: Expected ')'" exports[`function-bind.js [acorn] format 1`] = ` "Unexpected token (3:5) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind + 1 | // https://babeljs.io/docs/babel-plugin-proposal-function-bind 2 | > 3 | obj::func | ^ @@ -1006,7 +1006,7 @@ Cause: Unexpected token (3:4)" exports[`function-bind.js [espree] format 1`] = ` "Unexpected token : (3:5) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind + 1 | // https://babeljs.io/docs/babel-plugin-proposal-function-bind 2 | > 3 | obj::func | ^ @@ -1018,7 +1018,7 @@ Cause: Unexpected token :" exports[`function-bind.js [meriyah] format 1`] = ` "Unexpected token: ':' (3:5) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind + 1 | // https://babeljs.io/docs/babel-plugin-proposal-function-bind 2 | > 3 | obj::func | ^ @@ -1034,7 +1034,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-function-bind +// https://babeljs.io/docs/babel-plugin-proposal-function-bind obj::func // is equivalent to: @@ -1053,7 +1053,7 @@ func.call(obj, val) obj.func.call(obj, val) =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-function-bind +// https://babeljs.io/docs/babel-plugin-proposal-function-bind obj::func; // is equivalent to: @@ -1115,7 +1115,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-function-sent +// https://babeljs.io/docs/babel-plugin-proposal-function-sent function* generator() { console.log("Sent", function.sent); @@ -1127,7 +1127,7 @@ iterator.next(1); // Logs "Sent 1" iterator.next(2); // Logs "Yield 2" =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-function-sent +// https://babeljs.io/docs/babel-plugin-proposal-function-sent function* generator() { console.log("Sent", function.sent); @@ -1227,7 +1227,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-import-meta +// https://babeljs.io/docs/babel-plugin-syntax-import-meta // Enabled by default https://github.com/babel/babel/pull/11406 @@ -1247,7 +1247,7 @@ printWidth: 80 })(); =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-import-meta +// https://babeljs.io/docs/babel-plugin-syntax-import-meta // Enabled by default https://github.com/babel/babel/pull/11406 @@ -1275,7 +1275,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-jsx +// https://babeljs.io/docs/babel-plugin-syntax-jsx var profile =
@@ -1283,7 +1283,7 @@ var profile =
; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-syntax-jsx +// https://babeljs.io/docs/babel-plugin-syntax-jsx var profile = (
@@ -1301,7 +1301,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators +// https://babeljs.io/docs/babel-plugin-proposal-logical-assignment-operators a ||= b; obj.a.b ||= c; @@ -1310,7 +1310,7 @@ a &&= b; obj.a.b &&= c; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators +// https://babeljs.io/docs/babel-plugin-proposal-logical-assignment-operators a ||= b; obj.a.b ||= c; @@ -1393,12 +1393,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator +// https://babeljs.io/docs/babel-plugin-proposal-nullish-coalescing-operator var foo = object.foo ?? "default"; =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator +// https://babeljs.io/docs/babel-plugin-proposal-nullish-coalescing-operator var foo = object.foo ?? "default"; @@ -1411,7 +1411,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator +// https://babeljs.io/docs/babel-plugin-proposal-numeric-separator let budget = 1_000_000_000_000; @@ -1449,7 +1449,7 @@ let c = message & 0xff; console.log(c.toString(16), b); // c0, 192 =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator +// https://babeljs.io/docs/babel-plugin-proposal-numeric-separator let budget = 1_000_000_000_000; @@ -1495,7 +1495,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread +// https://babeljs.io/docs/babel-plugin-transform-object-rest-spread let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; console.log(x); // 1 @@ -1506,7 +1506,7 @@ let n = { x, y, ...z }; console.log(n); // { x: 1, y: 2, a: 3, b: 4 } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread +// https://babeljs.io/docs/babel-plugin-transform-object-rest-spread let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; console.log(x); // 1 @@ -1525,7 +1525,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-catch-binding +// https://babeljs.io/docs/babel-plugin-proposal-optional-catch-binding try { throw 0; @@ -1542,7 +1542,7 @@ try { } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-catch-binding +// https://babeljs.io/docs/babel-plugin-proposal-optional-catch-binding try { throw 0; @@ -1567,7 +1567,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining +// https://babeljs.io/docs/babel-plugin-proposal-optional-chaining const obj = { foo: { @@ -1631,7 +1631,7 @@ const obj4 = { const ret = delete obj?.foo?.bar?.baz; // true =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining +// https://babeljs.io/docs/babel-plugin-proposal-optional-chaining const obj = { foo: { @@ -1776,7 +1776,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-partial-application +// https://babeljs.io/docs/babel-plugin-proposal-partial-application function add(x, y) { return x + y; } @@ -1799,7 +1799,7 @@ o.f(?, x, ?) // partial application for any arg super.f(?) // partial application allowed for call on |SuperProperty| =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-partial-application +// https://babeljs.io/docs/babel-plugin-proposal-partial-application function add(x, y) { return x + y; @@ -1866,7 +1866,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/valtech-nyc/proposal-fsharp-pipelines promise @@ -1902,7 +1902,7 @@ newScore //=> 57 let newScore = boundScore(0, 100, add(7, double(person.score))); =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/valtech-nyc/proposal-fsharp-pipelines promise @@ -1977,7 +1977,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/js-choi/proposal-hack-pipes return list @@ -1987,7 +1987,7 @@ return list // (The % token isn't final; it might instead be @ or ? or #.) =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/js-choi/proposal-hack-pipes return list |> take(prefix.length, %) |> equals(%, prefix); @@ -2039,7 +2039,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/tc39/proposal-pipeline-operator/ let result = exclaim(capitalize(doubleSay("hello"))); @@ -2053,7 +2053,7 @@ let result = "hello" result //=> "Hello, hello!" =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/tc39/proposal-pipeline-operator/ let result = exclaim(capitalize(doubleSay("hello"))); @@ -2194,7 +2194,7 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-private-methods +// https://babeljs.io/docs/babel-plugin-proposal-private-methods // Test for \`classPrivateProperties\` and \`classPrivateMethods\` @@ -2215,7 +2215,7 @@ class Counter extends HTMLElement { } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-private-methods +// https://babeljs.io/docs/babel-plugin-proposal-private-methods // Test for \`classPrivateProperties\` and \`classPrivateMethods\` @@ -2406,7 +2406,7 @@ import.source("x"); exports[`throw-expressions.js [acorn] format 1`] = ` "Unexpected token (3:23) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-throw-expressions 2 | > 3 | function test(param = throw new Error('required!')) { | ^ @@ -2418,7 +2418,7 @@ Cause: Unexpected token (3:22)" exports[`throw-expressions.js [espree] format 1`] = ` "Unexpected token throw (3:23) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-throw-expressions 2 | > 3 | function test(param = throw new Error('required!')) { | ^ @@ -2430,7 +2430,7 @@ Cause: Unexpected token throw" exports[`throw-expressions.js [meriyah] format 1`] = ` "Unexpected token: 'throw' (3:23) - 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions + 1 | // https://babeljs.io/docs/babel-plugin-proposal-throw-expressions 2 | > 3 | function test(param = throw new Error('required!')) { | ^^^^^ @@ -2446,14 +2446,14 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions +// https://babeljs.io/docs/babel-plugin-proposal-throw-expressions function test(param = throw new Error('required!')) { const test = param === true || throw new Error('Falsy!'); } =====================================output===================================== -// https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions +// https://babeljs.io/docs/babel-plugin-proposal-throw-expressions function test(param = throw new Error("required!")) { const test = param === true || throw new Error("Falsy!"); @@ -2464,7 +2464,7 @@ function test(param = throw new Error("required!")) { exports[`typescript.js [__babel_estree] format 1`] = ` "Unexpected token (3:8) - 1 | // https://babeljs.io/docs/en/babel-preset-typescript + 1 | // https://babeljs.io/docs/babel-preset-typescript 2 | > 3 | const x: number = 0; | ^ @@ -2474,7 +2474,7 @@ Cause: Unexpected token (3:7)" exports[`typescript.js [acorn] format 1`] = ` "Unexpected token (3:8) - 1 | // https://babeljs.io/docs/en/babel-preset-typescript + 1 | // https://babeljs.io/docs/babel-preset-typescript 2 | > 3 | const x: number = 0; | ^ @@ -2484,7 +2484,7 @@ Cause: Unexpected token (3:7)" exports[`typescript.js [babel] format 1`] = ` "Unexpected token (3:8) - 1 | // https://babeljs.io/docs/en/babel-preset-typescript + 1 | // https://babeljs.io/docs/babel-preset-typescript 2 | > 3 | const x: number = 0; | ^ @@ -2498,12 +2498,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-preset-typescript +// https://babeljs.io/docs/babel-preset-typescript const x: number = 0; =====================================output===================================== -// https://babeljs.io/docs/en/babel-preset-typescript +// https://babeljs.io/docs/babel-preset-typescript const x: number = 0; @@ -2516,12 +2516,12 @@ parsers: ["babel", "babel-ts", "babel-flow"] printWidth: 80 | printWidth =====================================input====================================== -// https://babeljs.io/docs/en/babel-preset-typescript +// https://babeljs.io/docs/babel-preset-typescript const x: number = 0; =====================================output===================================== -// https://babeljs.io/docs/en/babel-preset-typescript +// https://babeljs.io/docs/babel-preset-typescript const x: number = 0; @@ -2530,7 +2530,7 @@ const x: number = 0; exports[`typescript.js [espree] format 1`] = ` "Unexpected token : (3:8) - 1 | // https://babeljs.io/docs/en/babel-preset-typescript + 1 | // https://babeljs.io/docs/babel-preset-typescript 2 | > 3 | const x: number = 0; | ^ @@ -2540,7 +2540,7 @@ Cause: Unexpected token :" exports[`typescript.js [meriyah] format 1`] = ` "Missing initializer in const declaration (3:8) - 1 | // https://babeljs.io/docs/en/babel-preset-typescript + 1 | // https://babeljs.io/docs/babel-preset-typescript 2 | > 3 | const x: number = 0; | ^ diff --git a/tests/format/js/babel-plugins/async-generators.js b/tests/format/js/babel-plugins/async-generators.js index d3fc2cdac2ba..841bf6f7fcfd 100644 --- a/tests/format/js/babel-plugins/async-generators.js +++ b/tests/format/js/babel-plugins/async-generators.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions +// https://babeljs.io/docs/babel-plugin-proposal-async-generator-functions async function* agf() { await 1; diff --git a/tests/format/js/babel-plugins/class-properties.js b/tests/format/js/babel-plugins/class-properties.js index 916c975a603f..c8b1c083b669 100644 --- a/tests/format/js/babel-plugins/class-properties.js +++ b/tests/format/js/babel-plugins/class-properties.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-class-properties +// https://babeljs.io/docs/babel-plugin-proposal-class-properties class Bork { //Property initializer syntax diff --git a/tests/format/js/babel-plugins/decorators.js b/tests/format/js/babel-plugins/decorators.js index 03744072ca93..470f2834073d 100644 --- a/tests/format/js/babel-plugins/decorators.js +++ b/tests/format/js/babel-plugins/decorators.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-decorators +// https://babeljs.io/docs/babel-plugin-proposal-decorators @annotation class MyClass { } diff --git a/tests/format/js/babel-plugins/do-expressions.js b/tests/format/js/babel-plugins/do-expressions.js index 5a139893dc35..13f276b14847 100644 --- a/tests/format/js/babel-plugins/do-expressions.js +++ b/tests/format/js/babel-plugins/do-expressions.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions +// https://babeljs.io/docs/babel-plugin-proposal-do-expressions let a = do { if(x > 10) { diff --git a/tests/format/js/babel-plugins/dynamic-import.js b/tests/format/js/babel-plugins/dynamic-import.js index bd361096dcd1..8c891a02ae84 100644 --- a/tests/format/js/babel-plugins/dynamic-import.js +++ b/tests/format/js/babel-plugins/dynamic-import.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-syntax-dynamic-import +// https://babeljs.io/docs/babel-plugin-syntax-dynamic-import // There is no example code on babel website diff --git a/tests/format/js/babel-plugins/export-default-from.js b/tests/format/js/babel-plugins/export-default-from.js index 67a17a8e4393..ce824ceed3a8 100644 --- a/tests/format/js/babel-plugins/export-default-from.js +++ b/tests/format/js/babel-plugins/export-default-from.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-export-default-from +// https://babeljs.io/docs/babel-plugin-proposal-export-default-from export v from 'mod'; diff --git a/tests/format/js/babel-plugins/export-namespace-from.js b/tests/format/js/babel-plugins/export-namespace-from.js index 9c06dcd5b2db..6525bdc75b93 100644 --- a/tests/format/js/babel-plugins/export-namespace-from.js +++ b/tests/format/js/babel-plugins/export-namespace-from.js @@ -1,3 +1,3 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-export-namespace-from +// https://babeljs.io/docs/babel-plugin-proposal-export-namespace-from export * as ns from 'mod'; diff --git a/tests/format/js/babel-plugins/flow.js b/tests/format/js/babel-plugins/flow.js index 44c0e33053d3..ae8f62f3d810 100644 --- a/tests/format/js/babel-plugins/flow.js +++ b/tests/format/js/babel-plugins/flow.js @@ -1,3 +1,3 @@ -// https://babeljs.io/docs/en/babel-preset-flow +// https://babeljs.io/docs/babel-preset-flow function foo(one: any, two: number, three?): string {} diff --git a/tests/format/js/babel-plugins/function-bind.js b/tests/format/js/babel-plugins/function-bind.js index 41075578e20c..144e94edb3a7 100644 --- a/tests/format/js/babel-plugins/function-bind.js +++ b/tests/format/js/babel-plugins/function-bind.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-function-bind +// https://babeljs.io/docs/babel-plugin-proposal-function-bind obj::func // is equivalent to: diff --git a/tests/format/js/babel-plugins/function-sent.js b/tests/format/js/babel-plugins/function-sent.js index f7fc8e3d04f9..e2601b0e5373 100644 --- a/tests/format/js/babel-plugins/function-sent.js +++ b/tests/format/js/babel-plugins/function-sent.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-function-sent +// https://babeljs.io/docs/babel-plugin-proposal-function-sent function* generator() { console.log("Sent", function.sent); diff --git a/tests/format/js/babel-plugins/import-meta.js b/tests/format/js/babel-plugins/import-meta.js index 3ef8f5a96466..0bc02cea0d63 100644 --- a/tests/format/js/babel-plugins/import-meta.js +++ b/tests/format/js/babel-plugins/import-meta.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-syntax-import-meta +// https://babeljs.io/docs/babel-plugin-syntax-import-meta // Enabled by default https://github.com/babel/babel/pull/11406 diff --git a/tests/format/js/babel-plugins/jsx.js b/tests/format/js/babel-plugins/jsx.js index f5a6d9ef0f02..d2ff9e3369ce 100644 --- a/tests/format/js/babel-plugins/jsx.js +++ b/tests/format/js/babel-plugins/jsx.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-syntax-jsx +// https://babeljs.io/docs/babel-plugin-syntax-jsx var profile =
diff --git a/tests/format/js/babel-plugins/logical-assignment-operators.js b/tests/format/js/babel-plugins/logical-assignment-operators.js index 43e332171e39..fba4a46c09c6 100644 --- a/tests/format/js/babel-plugins/logical-assignment-operators.js +++ b/tests/format/js/babel-plugins/logical-assignment-operators.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators +// https://babeljs.io/docs/babel-plugin-proposal-logical-assignment-operators a ||= b; obj.a.b ||= c; diff --git a/tests/format/js/babel-plugins/nullish-coalescing-operator.js b/tests/format/js/babel-plugins/nullish-coalescing-operator.js index b786659b2190..2ad3de0ca20e 100644 --- a/tests/format/js/babel-plugins/nullish-coalescing-operator.js +++ b/tests/format/js/babel-plugins/nullish-coalescing-operator.js @@ -1,3 +1,3 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator +// https://babeljs.io/docs/babel-plugin-proposal-nullish-coalescing-operator var foo = object.foo ?? "default"; diff --git a/tests/format/js/babel-plugins/numeric-separator.js b/tests/format/js/babel-plugins/numeric-separator.js index 3ea80118c7af..23066a9dcad7 100644 --- a/tests/format/js/babel-plugins/numeric-separator.js +++ b/tests/format/js/babel-plugins/numeric-separator.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator +// https://babeljs.io/docs/babel-plugin-proposal-numeric-separator let budget = 1_000_000_000_000; diff --git a/tests/format/js/babel-plugins/object-rest-spread.js b/tests/format/js/babel-plugins/object-rest-spread.js index 6e9ffbff024a..df90dd66915d 100644 --- a/tests/format/js/babel-plugins/object-rest-spread.js +++ b/tests/format/js/babel-plugins/object-rest-spread.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread +// https://babeljs.io/docs/babel-plugin-transform-object-rest-spread let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; console.log(x); // 1 diff --git a/tests/format/js/babel-plugins/optional-catch-binding.js b/tests/format/js/babel-plugins/optional-catch-binding.js index 1327104c7ddf..969b3ebebbcc 100644 --- a/tests/format/js/babel-plugins/optional-catch-binding.js +++ b/tests/format/js/babel-plugins/optional-catch-binding.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-catch-binding +// https://babeljs.io/docs/babel-plugin-proposal-optional-catch-binding try { throw 0; diff --git a/tests/format/js/babel-plugins/optional-chaining.js b/tests/format/js/babel-plugins/optional-chaining.js index d0d5842054ea..10522a9f2148 100644 --- a/tests/format/js/babel-plugins/optional-chaining.js +++ b/tests/format/js/babel-plugins/optional-chaining.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining +// https://babeljs.io/docs/babel-plugin-proposal-optional-chaining const obj = { foo: { diff --git a/tests/format/js/babel-plugins/partial-application.js b/tests/format/js/babel-plugins/partial-application.js index 6aaee6003315..a7b6f59b2dfc 100644 --- a/tests/format/js/babel-plugins/partial-application.js +++ b/tests/format/js/babel-plugins/partial-application.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-partial-application +// https://babeljs.io/docs/babel-plugin-proposal-partial-application function add(x, y) { return x + y; } diff --git a/tests/format/js/babel-plugins/pipeline-operator-fsharp.js b/tests/format/js/babel-plugins/pipeline-operator-fsharp.js index 66a7983722bb..feaad1f7b71d 100644 --- a/tests/format/js/babel-plugins/pipeline-operator-fsharp.js +++ b/tests/format/js/babel-plugins/pipeline-operator-fsharp.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/valtech-nyc/proposal-fsharp-pipelines promise diff --git a/tests/format/js/babel-plugins/pipeline-operator-hack.js b/tests/format/js/babel-plugins/pipeline-operator-hack.js index 553e20358126..1d8c19a51681 100644 --- a/tests/format/js/babel-plugins/pipeline-operator-hack.js +++ b/tests/format/js/babel-plugins/pipeline-operator-hack.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/js-choi/proposal-hack-pipes return list diff --git a/tests/format/js/babel-plugins/pipeline-operator-minimal.js b/tests/format/js/babel-plugins/pipeline-operator-minimal.js index e15c9d95ca70..a57a2bffb133 100644 --- a/tests/format/js/babel-plugins/pipeline-operator-minimal.js +++ b/tests/format/js/babel-plugins/pipeline-operator-minimal.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator +// https://babeljs.io/docs/babel-plugin-proposal-pipeline-operator // https://github.com/tc39/proposal-pipeline-operator/ let result = exclaim(capitalize(doubleSay("hello"))); diff --git a/tests/format/js/babel-plugins/private-methods.js b/tests/format/js/babel-plugins/private-methods.js index 0a9fc7c9f681..fed3387598eb 100644 --- a/tests/format/js/babel-plugins/private-methods.js +++ b/tests/format/js/babel-plugins/private-methods.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-private-methods +// https://babeljs.io/docs/babel-plugin-proposal-private-methods // Test for `classPrivateProperties` and `classPrivateMethods` diff --git a/tests/format/js/babel-plugins/throw-expressions.js b/tests/format/js/babel-plugins/throw-expressions.js index 3cded22842e3..2fb5facdefc9 100644 --- a/tests/format/js/babel-plugins/throw-expressions.js +++ b/tests/format/js/babel-plugins/throw-expressions.js @@ -1,4 +1,4 @@ -// https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions +// https://babeljs.io/docs/babel-plugin-proposal-throw-expressions function test(param = throw new Error('required!')) { const test = param === true || throw new Error('Falsy!'); diff --git a/tests/format/js/babel-plugins/typescript.js b/tests/format/js/babel-plugins/typescript.js index 7fe7124f31e7..9b0f9b2ba6b0 100644 --- a/tests/format/js/babel-plugins/typescript.js +++ b/tests/format/js/babel-plugins/typescript.js @@ -1,3 +1,3 @@ -// https://babeljs.io/docs/en/babel-preset-typescript +// https://babeljs.io/docs/babel-preset-typescript const x: number = 0; diff --git a/tests/format/misc/errors/js/format.test.js b/tests/format/misc/errors/js/format.test.js index ae4a491e1a73..37c98fd8f0de 100644 --- a/tests/format/misc/errors/js/format.test.js +++ b/tests/format/misc/errors/js/format.test.js @@ -10,7 +10,7 @@ runFormatTest( "const i = %DebugPrint;", // partialApplication - // https://babeljs.io/docs/en/babel-plugin-proposal-partial-application#invalid-usage + // https://babeljs.io/docs/babel-plugin-proposal-partial-application#invalid-usage "f(x + ?)", // `?` not in top-level Arguments of call "x + ?", // `?` not in top-level Arguments of call "?.f()", // `?` not in top-level Arguments of call diff --git a/tests/integration/__tests__/__snapshots__/plugin-api-embed.js.snap b/tests/integration/__tests__/__snapshots__/plugin-api-embed.js.snap index 5df728aded62..86bf2f6a8f55 100644 --- a/tests/integration/__tests__/__snapshots__/plugin-api-embed.js.snap +++ b/tests/integration/__tests__/__snapshots__/plugin-api-embed.js.snap @@ -7,4 +7,4 @@ exports[`embed API in plugins with new signature should work 1`] = ` " `; -exports[`embed API in plugins with outdated signature should cause error 1`] = `"printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed"`; +exports[`embed API in plugins with outdated signature should cause error 1`] = `"printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed"`; diff --git a/website/README.md b/website/README.md index 04c8961c3812..53af163b0e97 100644 --- a/website/README.md +++ b/website/README.md @@ -22,7 +22,7 @@ https://prettier.io/ This starts a server hosting the website locally at `http://localhost:3000/`. Any changes to the site's source files are reflected after refreshing the page, i.e. the server does not need to be restarted to show changes. - When working on the docs, you need to go to `http://localhost:3000/docs/en/next/index.html` (note “next”) to see your changes. + When working on the docs, you need to go to `http://localhost:3000/docs/next/index.html` (note “next”) to see your changes. ## Docusaurus @@ -40,7 +40,7 @@ The Playground is not integrated with the Docusaurus infrastructure. Its UI (`we The entry point of the playground is at `static/playground/index.html`. -Another part of the Playground is a web worker where formatting happens. It’s not managed by webpack and resides directly in `static/worker.js`. It expects to find the [UMD bundles of Prettier](https://prettier.io/docs/en/browser.html) in `static/lib/`. That’s why running `yarn build:website` or `PULL_REQUEST=true yarn build:website` in the project root is a required step. +Another part of the Playground is a web worker where formatting happens. It’s not managed by webpack and resides directly in `static/worker.js`. It expects to find the [UMD bundles of Prettier](https://prettier.io/docs/browser) in `static/lib/`. That’s why running `yarn build:website` or `PULL_REQUEST=true yarn build:website` in the project root is a required step. Finally, there is a service worker that caches Prettier’s relatively heavy bundles (`static/service-worker.js`). @@ -54,7 +54,7 @@ id: doc1 # used for docs to find each other and to map links title: Document Title layout: docs1 # used to determine different sidebar groupings category: Sidebar Category 1 # Category on the sidebar under which this doc goes -permalink: docs/en/doc1.html # link to the document that is used for site +permalink: docs/doc1.html # link to the document that is used for site previous: doc0 # previous doc on sidebar for navigation next: doc2 # next doc on the sidebar for navigation # don’t include next if this is the last doc; don’t include previous if first doc diff --git a/website/blog/2017-11-07-1.8.0.md b/website/blog/2017-11-07-1.8.0.md index 1e4396c2d5b5..fe467eebb20f 100644 --- a/website/blog/2017-11-07-1.8.0.md +++ b/website/blog/2017-11-07-1.8.0.md @@ -43,7 +43,7 @@ you and you may call me V. ``` > ~~Note: We're considering adding an option for this, check [#3183](https://github.com/prettier/prettier/pull/3183) for discussion.~~ -> Update: We've added an option in `1.8.2` called [`--no-prose-wrap`](https://prettier.io/docs/en/options.html#prose-wrap) +> Update: We've added an option in `1.8.2` called [`--no-prose-wrap`](https://prettier.io/docs/options#prose-wrap) > Note for CJK users: If your markdown renderer does not support CJK line ending, you'll have to use plugin like [markdown-it-perfect-newline-for-cjk](https://www.npmjs.com/package/markdown-it-perfect-newline-for-cjk), [hexo-filter-fix-cjk-spacing](https://www.npmjs.com/package/hexo-filter-fix-cjk-spacing), etc. to remove additional spaces. > @@ -134,7 +134,7 @@ const markdown = md` #### Add option to insert `@format` to first docblock if absent ([#2865](https://github.com/prettier/prettier/pull/2865)) by [@samouri](https://github.com/samouri) -In 1.7, we added an option called `--require-pragma` to require files contain an `/** @format */` pragma to be formatted. In order to add this pragma to a large set of files you can now use [`--insert-pragma`](https://prettier.io/docs/en/cli.html#insert-pragma) flag. +In 1.7, we added an option called `--require-pragma` to require files contain an `/** @format */` pragma to be formatted. In order to add this pragma to a large set of files you can now use [`--insert-pragma`](https://prettier.io/docs/cli#insert-pragma) flag. ``` prettier --write "folder/**/*.js" --insert-pragma @@ -142,7 +142,7 @@ prettier --write "folder/**/*.js" --insert-pragma #### Add `--loglevel` option ([#2992](https://github.com/prettier/prettier/pull/2992)) by [@ikatyang](https://github.com/ikatyang) -This [nifty feature](https://prettier.io/docs/en/cli.html#loglevel) allows you to opt in (or out) of Prettier's logging. We've also cleaned up the logging substantially since 1.7. +This [nifty feature](https://prettier.io/docs/cli#loglevel) allows you to opt in (or out) of Prettier's logging. We've also cleaned up the logging substantially since 1.7. ```bash diff --git a/website/blog/2018-01-10-1.10.0.md b/website/blog/2018-01-10-1.10.0.md index 2caa5ba0406e..a5d2b4202f43 100644 --- a/website/blog/2018-01-10-1.10.0.md +++ b/website/blog/2018-01-10-1.10.0.md @@ -456,4 +456,4 @@ Similarly, "JSON with comments" will also be detected. [#3643]: https://github.com/prettier/prettier/pull/3643 [#3649]: https://github.com/prettier/prettier/pull/3649 [#3694]: https://github.com/prettier/prettier/pull/3694 -[plugin api]: https://prettier.io/docs/en/plugins.html +[plugin api]: https://prettier.io/docs/plugins diff --git a/website/blog/2018-04-09-plugin-php-0.1.md b/website/blog/2018-04-09-plugin-php-0.1.md index 1b02652e41ad..2cefbe1ed45b 100644 --- a/website/blog/2018-04-09-plugin-php-0.1.md +++ b/website/blog/2018-04-09-plugin-php-0.1.md @@ -17,7 +17,7 @@ Adding support for a new language to Prettier requires two things: While we could benefit from existing work on the parsing side, the printer had to be developed from scratch to support all of PHP's various AST node types. Our first alpha release today means that we are confident that the printer can re-print your code without breaking it. -If you'd like to read more about the plugin API, see [the docs](https://prettier.io/docs/en/plugins.html). +If you'd like to read more about the plugin API, see [the docs](https://prettier.io/docs/plugins). ## Philosophy diff --git a/website/blog/2018-04-11-1.12.0.md b/website/blog/2018-04-11-1.12.0.md index d1309ec482a2..25ea7e0814ba 100644 --- a/website/blog/2018-04-11-1.12.0.md +++ b/website/blog/2018-04-11-1.12.0.md @@ -218,7 +218,7 @@ const { #### Support hasPragma/insertPragma ([#4275](https://github.com/prettier/prettier/pull/4275) by [@ikatyang](https://github.com/ikatyang)) -Prettier 1.7.0 and 1.8.0 introduced two new options, [`--require-pragma`](https://prettier.io/docs/en/options.html#require-pragma) and [`--insert-pragma`](https://prettier.io/docs/en/options.html#insert-pragma). However, these options were only supported in JavaScript. Now these options are available in Markdown, too! +Prettier 1.7.0 and 1.8.0 introduced two new options, [`--require-pragma`](https://prettier.io/docs/options#require-pragma) and [`--insert-pragma`](https://prettier.io/docs/options#insert-pragma). However, these options were only supported in JavaScript. Now these options are available in Markdown, too! ```md @@ -232,7 +232,7 @@ A long time ago, in my hometown of Ericsburgh... When using tools such as [all-contributors](https://github.com/kentcdodds/all-contributors) or [markdown-toc](https://github.com/jonschlinkert/markdown-toc), users were running into situations where autogenerated Markdown content was formatted oddly by Prettier, or Prettier's `--list-different` mode was flagging autogenerated content that the user didn't care about formatting. -To solve these problems, we have added a new type of ignore comment to Markdown, called [Range Ignore](https://prettier.io/docs/en/ignore.html#range-ignore): +To solve these problems, we have added a new type of ignore comment to Markdown, called [Range Ignore](https://prettier.io/docs/ignore#range-ignore): ```md @@ -267,7 +267,7 @@ Prettier 1.11.1 failed to parse the new style; we now support both styles. #### Move pragma detection/insertion to plugins ([#3685](https://github.com/prettier/prettier/pull/3685) by [@duailibe](https://github.com/duailibe)) -Prettier plugins can now include a `hasPragma` function in their [parser](https://prettier.io/docs/en/plugins.html#parsers) and an `insertPragma` function in their [printer](https://prettier.io/docs/en/plugins.html#printers) to opt-in to `--insert-pragma` and `--require-pragma` support. These are their signatures: +Prettier plugins can now include a `hasPragma` function in their [parser](https://prettier.io/docs/plugins#parsers) and an `insertPragma` function in their [printer](https://prettier.io/docs/plugins#printers) to opt-in to `--insert-pragma` and `--require-pragma` support. These are their signatures: ```ts function hasPragma(text: string): boolean; @@ -883,7 +883,7 @@ Prettier 1.11.1 did not handle self-closing style or script tags correctly in vu #### Fix printing ignored files with --debug-check ([#4066](https://github.com/prettier/prettier/pull/4066) by [@duailibe](https://github.com/duailibe)) -Prettier 1.11.1 was mistakenly outputting the contents of ignored files when the [`--debug-check`](https://prettier.io/docs/en/cli.html#debug-check) flag was used. In Prettier 1.12.0, the contents of ignored files are no longer written to stdout. +Prettier 1.11.1 was mistakenly outputting the contents of ignored files when the [`--debug-check`](https://prettier.io/docs/cli#debug-check) flag was used. In Prettier 1.12.0, the contents of ignored files are no longer written to stdout. --- diff --git a/website/blog/2018-05-27-1.13.0.md b/website/blog/2018-05-27-1.13.0.md index 53e06155c452..287c2273c03f 100644 --- a/website/blog/2018-05-27-1.13.0.md +++ b/website/blog/2018-05-27-1.13.0.md @@ -32,7 +32,7 @@ formatButton.addEventListener("click", function() { }); ``` -Read more about it in the [docs](https://prettier.io/docs/en/browser.html) or try it on this [JS Bin](https://jsbin.com/vabiyomoso/edit?html,output). +Read more about it in the [docs](https://prettier.io/docs/browser) or try it on this [JS Bin](https://jsbin.com/vabiyomoso/edit?html,output). #### Don't default to the JavaScript parser ([#4528] by [@duailibe]) @@ -51,13 +51,13 @@ When using the JavaScript API, `prettier.format` and `prettier.formatWithCursor` When invoking Prettier from the API, there was no way to find out if a file should be ignored or not (for `.prettierignore`) so editor integration plugins would have to implement this logic. Also, there was no way to find out if a file was supported by Prettier, so users would need to call Prettier anyway. In 1.13 there's a way to check if a parser will be inferred (and which one) and if the file is ignored or not before actually calling `format`. -You can read more about this in the [docs](https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath-options). +You can read more about this in the [docs](https://prettier.io/docs/api#prettiergetfileinfofilepath-options). #### Support for global Prettier and plugins ([#4192] by [@kachkaev]) When installing Prettier and plugins globally, Prettier was not able to automatically load plugins because it searched for them in the nearest `package.json`. Now Prettier will look for plugins in the `node_modules` directory it's installed in. Additionally, for cases where Prettier can't find the plugins automatically (because of other setups we haven't added support for), a new `--plugin-search-dir` option was added so you can specify where Prettier should search for plugins. -You can read more about this in the [Plugin docs](https://prettier.io/docs/en/plugins.html#using-plugins). +You can read more about this in the [Plugin docs](https://prettier.io/docs/plugins#using-plugins). #### Improve cursor offset tracking ([#4397] by [@ds300]) @@ -133,7 +133,7 @@ d3.select("body") #### Format new `describe.each` table in Jest 23 ([#4423] by [@ikatyang]) -Jest 23 introduced a new feature called [data driven tests](https://facebook.github.io/jest/docs/en/api.html#describeeachtable-name-fn) where you can describe examples to test in a table. Prettier 1.13 includes support for this feature, and will automatically indent the table when using data driven tests. +Jest 23 introduced a new feature called [data driven tests](https://jestjs.io/docs/api#describename-fn) where you can describe examples to test in a table. Prettier 1.13 includes support for this feature, and will automatically indent the table when using data driven tests. ```js diff --git a/website/blog/2018-07-29-1.14.0.md b/website/blog/2018-07-29-1.14.0.md index f49fdc2fe695..01c6399c120e 100644 --- a/website/blog/2018-07-29-1.14.0.md +++ b/website/blog/2018-07-29-1.14.0.md @@ -46,7 +46,7 @@ Output: (`--prose-wrap always`) that it’s my very good honour to meet you and you may call me V. ``` -> Note: the [`proseWrap`](https://prettier.io/docs/en/options.html#prose-wrap) option is set to `preserve` by default so you’ll have to specify `always` or `never` to enable this feature. +> Note: the [`proseWrap`](https://prettier.io/docs/options#prose-wrap) option is set to `preserve` by default so you’ll have to specify `always` or `never` to enable this feature. ##### Ignore a portion of the file @@ -96,8 +96,8 @@ content #### Support `requirePragma`/`insertPragma` in every language ([#4688], [#4699], [#4713] by [@ikatyang]) Prettier 1.7.0 and 1.8.0 introduced two new options: -[`--require-pragma`](https://prettier.io/docs/en/options.html#require-pragma) and -[`--insert-pragma`](https://prettier.io/docs/en/options.html#insert-pragma). +[`--require-pragma`](https://prettier.io/docs/options#require-pragma) and +[`--insert-pragma`](https://prettier.io/docs/options#insert-pragma). However, these options were only supported in a few languages. Now these options are available in every language, including YAML! @@ -662,7 +662,7 @@ const doBothThings = async () => { #### Allow top level `super` and `await` ([#4823] by [@ikatyang]) `super` and `await` are not allowed to be in places other than classes and async functions, respectively, -but our [range format](https://prettier.io/docs/en/options.html#range) option didn’t quite work properly when selecting the contents of a function. +but our [range format](https://prettier.io/docs/options#range) option didn’t quite work properly when selecting the contents of a function. Prettier 1.14 allows them to be everywhere. @@ -958,7 +958,7 @@ Prettier 1.14 correctly recognizes these characters so they won’t be transform #### Support range format for Vue files ([#4868] by [@ikatyang]) -Previously, [range formatting](https://prettier.io/docs/en/options.html#range) was not available in Vue, +Previously, [range formatting](https://prettier.io/docs/options#range) was not available in Vue, but Prettier 1.14 adds support for it. ### GraphQL diff --git a/website/blog/2018-11-07-1.15.0.md b/website/blog/2018-11-07-1.15.0.md index 989eac711703..677c7ad59cdc 100644 --- a/website/blog/2018-11-07-1.15.0.md +++ b/website/blog/2018-11-07-1.15.0.md @@ -116,7 +116,7 @@ Prettier uses filename to infer which parser to use. Here's the default patterns Make sure your filename matches the correct parser (especially for Angular users); if it does not, you will have to manually specify which parser to use via the [overrides] field. -[overrides]: https://prettier.io/docs/en/configuration.html#configuration-overrides +[overrides]: https://prettier.io/docs/configuration#configuration-overrides Note that framework-specific formatting won't be triggered in `--parser html`. diff --git a/website/blog/2019-01-20-1.16.0.md b/website/blog/2019-01-20-1.16.0.md index 21e944f1d4ee..36ebc1d4dcce 100644 --- a/website/blog/2019-01-20-1.16.0.md +++ b/website/blog/2019-01-20-1.16.0.md @@ -100,7 +100,7 @@ The `babylon` parser name is now deprecated but it still works. If you need to change your config due to this change, please take a second to read [our docs on the `parser` option], especially the note at the bottom. -[our docs on the `parser` option]: https://prettier.io/docs/en/configuration.html#setting-the-parser-docs-en-optionshtml-parser-option +[our docs on the `parser` option]: https://prettier.io/docs/configuration#setting-the-parser-docs-en-optionshtml-parser-option ### Flow diff --git a/website/blog/2019-11-09-1.19.0.md b/website/blog/2019-11-09-1.19.0.md index 48c2a5ba1e66..7ab4e097ec28 100644 --- a/website/blog/2019-11-09-1.19.0.md +++ b/website/blog/2019-11-09-1.19.0.md @@ -13,7 +13,7 @@ This release adds the long awaited `--vue-indent-script-and-style` option, suppo #### Add `--vue-indent-script-and-style` ([#6157] by [@kamilic]) -The new [`--vue-indent-script-and-style`](https://prettier.io/docs/en/options.html#vue-files-script-and-style-tags-indentation) option controls whether or not to indent the code inside ` - + +