From e4af667e03c27d79ddc7c387c7428aa3b52eb16e Mon Sep 17 00:00:00 2001 From: Adrian Leonhard Date: Mon, 29 Aug 2022 14:06:41 +0200 Subject: [PATCH 1/8] docs: plugins.md: add getCommentChildNodes (#12502) --- docs/plugins.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/plugins.md b/docs/plugins.md index d599cf544..5c1d754e4 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -163,6 +163,7 @@ export const printers = { canAttachComment, isBlockComment, printComment, + getCommentChildNodes, handleComments: { ownLine, endOfLine, @@ -297,6 +298,21 @@ Comments are often not part of a language's AST and present a challenge for pret By default, if the AST has a top-level `comments` property, Prettier assumes that `comments` stores an array of comment nodes. Prettier will then use the provided `parsers[].locStart`/`locEnd` functions to search for the AST node that each comment "belongs" to. Comments are then attached to these nodes **mutating the AST in the process**, and the `comments` property is deleted from the AST root. The `*Comment` functions are used to adjust Prettier's algorithm. Once the comments are attached to the AST, Prettier will automatically call the `printComment(path, options): Doc` function and insert the returned doc into the (hopefully) correct place. +#### (optional) `getCommentChildNodes` + +By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively. This function can be provided to override that behavior. It has the signature: + +```ts +function getCommentChildNodes( + // The node whose children should be returned. + node: AST, + // Current options + options: object +): AST[] | undefined; +``` + +Return `[]` if the node has no children or `undefined` to fall back on the default behavior. + #### (optional) `printComment` Called whenever a comment node needs to be printed. It has the signature: From f48f514deb932ff11a6d22dde4dbd6ee837be5cf Mon Sep 17 00:00:00 2001 From: Dinika Date: Mon, 29 Aug 2022 15:21:18 +0200 Subject: [PATCH 2/8] Update integrating-with-linters.md (#12363) --- docs/integrating-with-linters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrating-with-linters.md b/docs/integrating-with-linters.md index bd6c125d0..0c4a7e339 100644 --- a/docs/integrating-with-linters.md +++ b/docs/integrating-with-linters.md @@ -29,7 +29,7 @@ The downsides of those plugins are: - They are slower than running Prettier directly. - They’re yet one layer of indirection where things may break. -Finally, we have tools that run `prettier` and then immediately for example `eslint --fix` on files. +Finally, we have tools that run `prettier` and then immediately lint files by running, for example, `eslint --fix` on them. - [prettier-eslint](https://github.com/prettier/prettier-eslint) - [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint) From 9850bc6af3c50b2079eabfe6eadc5ec531aeec5a Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Mon, 29 Aug 2022 15:24:02 +0200 Subject: [PATCH 3/8] docs(configuration): linkfix (#12005) * docs(configuration): linkfix * Link to the `overrides` section in new ESLint website * Update stable version docs too Co-authored-by: fisker Cheung --- docs/configuration.md | 2 +- website/versioned_docs/version-stable/configuration.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 3d8c40920..12f6c712f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -66,7 +66,7 @@ singleQuote = true Overrides let you have different configuration for certain file extensions, folders and specific files. -Prettier borrows ESLint’s [override format](https://eslint.org/docs/user-guide/configuring#example-configuration). +Prettier borrows ESLint’s [override format](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#how-do-overrides-work). JSON: diff --git a/website/versioned_docs/version-stable/configuration.md b/website/versioned_docs/version-stable/configuration.md index 148d900f2..547c8bef8 100644 --- a/website/versioned_docs/version-stable/configuration.md +++ b/website/versioned_docs/version-stable/configuration.md @@ -67,7 +67,7 @@ singleQuote = true Overrides let you have different configuration for certain file extensions, folders and specific files. -Prettier borrows ESLint’s [override format](https://eslint.org/docs/user-guide/configuring#example-configuration). +Prettier borrows ESLint’s [override format](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#how-do-overrides-work). JSON: From 68bd87b24ba00049ac74870de75596639fd967bb Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 31 Aug 2022 00:59:20 +0900 Subject: [PATCH 4/8] Fix generated changelog comment for css like syntax (#13403) Fix generated comment for css like syntax --- scripts/generate-changelog.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/generate-changelog.mjs b/scripts/generate-changelog.mjs index 8578dfd6d..f3d9e7ffc 100644 --- a/scripts/generate-changelog.mjs +++ b/scripts/generate-changelog.mjs @@ -154,6 +154,10 @@ function getSyntaxFromCategory(category) { return "jsx"; case "typescript": return "tsx"; + case "css": + case "scss": + case "less": + return "css"; default: return category; } @@ -175,6 +179,8 @@ function getCommentForSyntax(syntax, comment) { return `# ${comment}`; case "hbs": return `{{! ${comment} }}`; + case "css": + return `/* ${comment} */`; default: return `// ${comment}`; } From 98b93cfb038fbb49cf29f8fcb6a717b88c957f3f Mon Sep 17 00:00:00 2001 From: Ryan Vandersmith Date: Thu, 1 Sep 2022 19:03:52 -0600 Subject: [PATCH 5/8] Add `prettier-plugin-motoko` to community plugin list (#13406) --- cspell.json | 1 + docs/plugins.md | 1 + 2 files changed, 2 insertions(+) diff --git a/cspell.json b/cspell.json index ed51d0e90..d2cb167bf 100644 --- a/cspell.json +++ b/cspell.json @@ -214,6 +214,7 @@ "Monteiro", "Morrell", "motiz", + "Motoko", "mousedown", "mouseup", "mprettier", diff --git a/docs/plugins.md b/docs/plugins.md index 5c1d754e4..3cb936e3b 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -66,6 +66,7 @@ To turn off plugin autoloading, use `--no-plugin-search` when using Prettier CLI - [`prettier-plugin-java`](https://github.com/jhipster/prettier-java) by [**@JHipster**](https://github.com/jhipster) - [`prettier-plugin-jsonata`](https://github.com/Stedi/prettier-plugin-jsonata) by [**@Stedi**](https://github.com/Stedi) - [`prettier-plugin-kotlin`](https://github.com/Angry-Potato/prettier-plugin-kotlin) by [**@Angry-Potato**](https://github.com/Angry-Potato) +- [`prettier-plugin-motoko`](https://github.com/dfinity/prettier-plugin-motoko) by [**@dfinity**](https://github.com/dfinity) - [`prettier-plugin-nginx`](https://github.com/joedeandev/prettier-plugin-nginx) by [**@joedeandev**](https://github.com/joedeandev) - [`prettier-plugin-prisma`](https://github.com/umidbekk/prettier-plugin-prisma) by [**@umidbekk**](https://github.com/umidbekk) - [`prettier-plugin-properties`](https://github.com/eemeli/prettier-plugin-properties) by [**@eemeli**](https://github.com/eemeli) From ed4c3c19eb91bd8a0ea51c709c707443b2a3b064 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:16:12 +0800 Subject: [PATCH 6/8] Build(deps-dev): Bump node-fetch from 3.2.3 to 3.2.10 (#13408) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.2.3 to 3.2.10. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v3.2.3...v3.2.10) --- updated-dependencies: - dependency-name: node-fetch dependency-type: direct:development ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2a8261c47..60d009561 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "jest-snapshot-serializer-raw": "1.2.0", "jest-watch-typeahead": "1.0.0", "node-actionlint": "1.2.2", - "node-fetch": "3.2.3", + "node-fetch": "3.2.10", "npm-run-all": "4.1.5", "path-browserify": "1.0.1", "prettier": "2.7.1", diff --git a/yarn.lock b/yarn.lock index e3c427e3d..0be6db91d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5052,10 +5052,10 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.3.tgz#a03c9cc2044d21d1a021566bd52f080f333719a6" - integrity sha512-AXP18u4pidSZ1xYXRDPY/8jdv3RAozIt/WLNR/MBGZAz+xjtlr90RvCnsvHQRiXyWliZF/CpytExp32UU67/SA== +node-fetch@3.2.10: + version "3.2.10" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" + integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" From c51d509560b713fdef9590fc60a55329c8660671 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:18:01 +0800 Subject: [PATCH 7/8] Build(deps): Bump node-fetch from 3.2.3 to 3.2.10 in /scripts/release (#13411) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.2.3 to 3.2.10. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v3.2.3...v3.2.10) --- updated-dependencies: - dependency-name: node-fetch dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/release/package.json | 2 +- scripts/release/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/release/package.json b/scripts/release/package.json index a1bd2cdfc..ec336a3f0 100644 --- a/scripts/release/package.json +++ b/scripts/release/package.json @@ -9,7 +9,7 @@ "enquirer": "2.3.6", "execa": "6.1.0", "minimist": "1.2.6", - "node-fetch": "3.2.3", + "node-fetch": "3.2.10", "outdent": "0.8.0", "semver": "7.3.7", "string-width": "5.1.2" diff --git a/scripts/release/yarn.lock b/scripts/release/yarn.lock index a1fc05b1c..3b490ac31 100644 --- a/scripts/release/yarn.lock +++ b/scripts/release/yarn.lock @@ -2013,10 +2013,10 @@ node-domexception@^1.0.0: resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@3.2.3: - version "3.2.3" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.3.tgz" - integrity sha512-AXP18u4pidSZ1xYXRDPY/8jdv3RAozIt/WLNR/MBGZAz+xjtlr90RvCnsvHQRiXyWliZF/CpytExp32UU67/SA== +node-fetch@3.2.10: + version "3.2.10" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" + integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" From 371c7093d0fe1c0ef244ac009c7b7573948c7f09 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 6 Sep 2022 14:40:59 +0800 Subject: [PATCH 8/8] Group `@typescript-eslint/*` dependencies in renovate config (#13430) --- .github/renovate.json5 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f3dd88ef6..74f9dfb2f 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -14,6 +14,10 @@ excludePackageNames: ["@babel/parser"], groupName: "babel", }, + { + matchPackagePrefixes: ["@typescript-eslint/"], + groupName: "typescript-eslint", + }, { branchPrefix: "renovate/website/", matchPaths: ["website/package.json"],