Merge branch 'main' into next

# Conflicts:
#	package.json
#	scripts/release/yarn.lock
#	yarn.lock
This commit is contained in:
fisker Cheung committed 2022-09-06 19:22:51 +08:00
commit 151ab582b5
9 files changed
+37 -9

No files matched your search

+4
View File
@@ -14,6 +14,10 @@
excludePackageNames: ["@babel/parser"], excludePackageNames: ["@babel/parser"],
groupName: "babel", groupName: "babel",
}, },
{
matchPackagePrefixes: ["@typescript-eslint/"],
groupName: "typescript-eslint",
},
{ {
branchPrefix: "renovate/website/", branchPrefix: "renovate/website/",
matchPaths: ["website/package.json"], matchPaths: ["website/package.json"],
+1
View File
@@ -206,6 +206,7 @@
"Monteiro", "Monteiro",
"Morrell", "Morrell",
"motiz", "motiz",
"Motoko",
"mousedown", "mousedown",
"mouseup", "mouseup",
"mprettier", "mprettier",
+1 -1
View File
@@ -80,7 +80,7 @@ singleQuote = true
Overrides let you have different configuration for certain file extensions, folders and specific files. 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: JSON:
+1 -1
View File
@@ -29,7 +29,7 @@ The downsides of those plugins are:
- They are slower than running Prettier directly. - They are slower than running Prettier directly.
- They’re yet one layer of indirection where things may break. - 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-eslint](https://github.com/prettier/prettier-eslint)
- [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint) - [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint)
+17
View File
@@ -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-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-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-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-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-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) - [`prettier-plugin-properties`](https://github.com/eemeli/prettier-plugin-properties) by [**@eemeli**](https://github.com/eemeli)
@@ -164,6 +165,7 @@ export const printers = {
canAttachComment, canAttachComment,
isBlockComment, isBlockComment,
printComment, printComment,
getCommentChildNodes,
handleComments: { handleComments: {
ownLine, ownLine,
endOfLine, endOfLine,
@@ -373,6 +375,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[<plugin>].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. 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[<plugin>].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` #### (optional) `printComment`
Called whenever a comment node needs to be printed. It has the signature: Called whenever a comment node needs to be printed. It has the signature:
+1 -1
View File
@@ -132,7 +132,7 @@
"jest-snapshot-serializer-raw": "1.2.0", "jest-snapshot-serializer-raw": "1.2.0",
"jest-watch-typeahead": "2.1.1", "jest-watch-typeahead": "2.1.1",
"node-actionlint": "1.2.2", "node-actionlint": "1.2.2",
"node-fetch": "3.2.4", "node-fetch": "3.2.10",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"path-browserify": "1.0.1", "path-browserify": "1.0.1",
"prettier": "2.7.1", "prettier": "2.7.1",
+6
View File
@@ -154,6 +154,10 @@ function getSyntaxFromCategory(category) {
return "jsx"; return "jsx";
case "typescript": case "typescript":
return "tsx"; return "tsx";
case "css":
case "scss":
case "less":
return "css";
default: default:
return category; return category;
} }
@@ -175,6 +179,8 @@ function getCommentForSyntax(syntax, comment) {
return `# ${comment}`; return `# ${comment}`;
case "hbs": case "hbs":
return `{{! ${comment} }}`; return `{{! ${comment} }}`;
case "css":
return `/* ${comment} */`;
default: default:
return `// ${comment}`; return `// ${comment}`;
} }
@@ -67,7 +67,7 @@ singleQuote = true
Overrides let you have different configuration for certain file extensions, folders and specific files. 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: JSON:
+5 -5
View File
@@ -6241,14 +6241,14 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"node-fetch@npm:3.2.4": "node-fetch@npm:3.2.10":
version: 3.2.4 version: 3.2.10
resolution: "node-fetch@npm:3.2.4" resolution: "node-fetch@npm:3.2.10"
dependencies: dependencies:
data-uri-to-buffer: ^4.0.0 data-uri-to-buffer: ^4.0.0
fetch-blob: ^3.1.4 fetch-blob: ^3.1.4
formdata-polyfill: ^4.0.10 formdata-polyfill: ^4.0.10
checksum: cfc715441302167bd4a9c6d6f3ff8eecb65e5aeeccd55a690497dcce5f95ec017d65c5682414287cad3998a28b1bab4820dcbe51852902eaa5f15f3975562384 checksum: e65322431f4897ded04197aa5923eaec63a8d53e00432de4e70a4f7006625c8dc32629c5c35f4fe8ee719a4825544d07bf53f6e146a7265914262f493e8deac1
languageName: node languageName: node
linkType: hard linkType: hard
@@ -6971,7 +6971,7 @@ __metadata:
minimist: 1.2.6 minimist: 1.2.6
n-readlines: 1.0.1 n-readlines: 1.0.1
node-actionlint: 1.2.2 node-actionlint: 1.2.2
node-fetch: 3.2.4 node-fetch: 3.2.10
npm-run-all: 4.1.5 npm-run-all: 4.1.5
outdent: 0.8.0 outdent: 0.8.0
parse-srcset: "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee" parse-srcset: "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee"