Bump Prettier dependency to 3.0.0
This commit is contained in:
1 parent
151cc2c4f2
commit
fa48415617
338 files changed
+1483
-1434
No files matched your search
+2
-2
@@ -112,7 +112,7 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
parser: "babel",
|
||||
plugins: [pluginBabel],
|
||||
})
|
||||
}),
|
||||
);
|
||||
// Output: const html = /* HTML */ `<DIV> </DIV>`;
|
||||
</script>
|
||||
@@ -130,7 +130,7 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
parser: "babel",
|
||||
plugins: [pluginBabel, pluginHtml],
|
||||
})
|
||||
}),
|
||||
);
|
||||
// Output: const html = /* HTML */ `<div></div>`;
|
||||
</script>
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ foo(
|
||||
reallyLongArg(),
|
||||
omgSoManyParameters(),
|
||||
IShouldRefactorThis(),
|
||||
isThereSeriouslyAnotherOne()
|
||||
isThereSeriouslyAnotherOne(),
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
+24
-24
@@ -194,7 +194,7 @@ function print(
|
||||
path: AstPath,
|
||||
options: object,
|
||||
// Recursively print a child node
|
||||
print: (selector?: string | number | Array<string | number> | AstPath) => Doc
|
||||
print: (selector?: string | number | Array<string | number> | AstPath) => Doc,
|
||||
): Doc;
|
||||
```
|
||||
|
||||
@@ -250,7 +250,7 @@ function embed(
|
||||
// Path to the current AST node
|
||||
path: AstPath,
|
||||
// Current options
|
||||
options: Options
|
||||
options: Options,
|
||||
):
|
||||
| ((
|
||||
// Parses and prints the passed text using a different parser.
|
||||
@@ -258,12 +258,12 @@ function embed(
|
||||
textToDoc: (text: string, options: Options) => Promise<Doc>,
|
||||
// Prints the current node or its descendant node with the current printer
|
||||
print: (
|
||||
selector?: string | number | Array<string | number> | AstPath
|
||||
selector?: string | number | Array<string | number> | AstPath,
|
||||
) => Doc,
|
||||
// The following two arguments are passed for convenience.
|
||||
// They're the same `path` and `options` that are passed to `embed`.
|
||||
path: AstPath,
|
||||
options: Options
|
||||
options: Options,
|
||||
) => Promise<Doc | undefined> | Doc | undefined)
|
||||
| Doc
|
||||
| undefined;
|
||||
@@ -346,7 +346,7 @@ const ignoredKeys = new Set(["prev", "next", "range"]);
|
||||
|
||||
function getVisitorKeys(node, nonTraversableKeys) {
|
||||
return Object.keys(node).filter(
|
||||
(key) => !nonTraversableKeys.has(key) && !ignoredKeys.has(key)
|
||||
(key) => !nonTraversableKeys.has(key) && !ignoredKeys.has(key),
|
||||
);
|
||||
}
|
||||
```
|
||||
@@ -374,7 +374,7 @@ function getCommentChildNodes(
|
||||
// The node whose children should be returned.
|
||||
node: AST,
|
||||
// Current options
|
||||
options: object
|
||||
options: object,
|
||||
): AST[] | undefined;
|
||||
```
|
||||
|
||||
@@ -389,7 +389,7 @@ function printComment(
|
||||
// Path to the current comment node
|
||||
commentPath: AstPath,
|
||||
// Current options
|
||||
options: object
|
||||
options: object,
|
||||
): Doc;
|
||||
```
|
||||
|
||||
@@ -430,7 +430,7 @@ The `handleComments` object contains three optional functions, each with signatu
|
||||
// The AST
|
||||
ast: AST,
|
||||
// Whether this comment is the last comment
|
||||
isLastComment: boolean
|
||||
isLastComment: boolean,
|
||||
) => boolean;
|
||||
```
|
||||
|
||||
@@ -517,91 +517,91 @@ function getStringWidth(text: string): number;
|
||||
function getAlignmentSize(
|
||||
text: string,
|
||||
tabWidth: number,
|
||||
startIndex?: number
|
||||
startIndex?: number,
|
||||
): number;
|
||||
|
||||
function getIndentSize(value: string, tabWidth: number): number;
|
||||
|
||||
function skip(
|
||||
characters: string | RegExp
|
||||
characters: string | RegExp,
|
||||
): (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
function skipWhitespace(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): number | false;
|
||||
|
||||
function skipSpaces(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): number | false;
|
||||
|
||||
function skipToLineEnd(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): number | false;
|
||||
|
||||
function skipEverythingButNewLine(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): number | false;
|
||||
|
||||
function skipInlineComment(
|
||||
text: string,
|
||||
startIndex: number | false
|
||||
startIndex: number | false,
|
||||
): number | false;
|
||||
|
||||
function skipTrailingComment(
|
||||
text: string,
|
||||
startIndex: number | false
|
||||
startIndex: number | false,
|
||||
): number | false;
|
||||
|
||||
function skipNewline(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): number | false;
|
||||
|
||||
function hasNewline(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): boolean;
|
||||
|
||||
function hasNewlineInRange(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
startIndex: number
|
||||
startIndex: number,
|
||||
): boolean;
|
||||
|
||||
function hasSpaces(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
): boolean;
|
||||
|
||||
function makeString(
|
||||
rawText: string,
|
||||
enclosingQuote: Quote,
|
||||
unescapeUnnecessaryEscapes?: boolean
|
||||
unescapeUnnecessaryEscapes?: boolean,
|
||||
): string;
|
||||
|
||||
function getNextNonSpaceNonCommentCharacter(
|
||||
text: string,
|
||||
startIndex: number
|
||||
startIndex: number,
|
||||
): string;
|
||||
|
||||
function getNextNonSpaceNonCommentCharacterIndex(
|
||||
text: string,
|
||||
startIndex: number
|
||||
startIndex: number,
|
||||
): number | false;
|
||||
|
||||
function isNextLineEmpty(text: string, startIndex: number): boolean;
|
||||
|
||||
Reference in new issue
Block a user