prettier 3.0.0-alpha.6 → 3.0.0-alpha.7-for-vscode
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -17
- package/bin/prettier.cjs +0 -0
- package/doc.d.ts +2 -10
- package/doc.js +55 -246
- package/doc.mjs +51 -246
- package/index.cjs +20567 -478
- package/index.d.ts +26 -8
- package/index.mjs +5920 -20834
- package/internal/cli.mjs +486 -478
- package/internal/internal.cjs +6430 -0
- package/internal/{third-party.mjs → internal.mjs} +19 -14
- package/package.json +40 -29
- package/plugins/acorn.d.ts +6 -0
- package/plugins/acorn.js +13 -0
- package/plugins/acorn.mjs +13 -0
- package/plugins/angular.d.ts +5 -9
- package/plugins/angular.js +2 -2
- package/plugins/angular.mjs +2 -2
- package/plugins/babel.d.ts +14 -14
- package/plugins/babel.js +11 -11
- package/plugins/babel.mjs +11 -11
- package/plugins/estree.d.ts +0 -0
- package/plugins/estree.js +35 -0
- package/plugins/estree.mjs +35 -0
- package/plugins/flow.d.ts +2 -6
- package/plugins/flow.js +20 -20
- package/plugins/flow.mjs +20 -20
- package/plugins/glimmer.d.ts +2 -6
- package/plugins/glimmer.js +22 -17
- package/plugins/glimmer.mjs +22 -17
- package/plugins/graphql.d.ts +2 -6
- package/plugins/graphql.js +16 -7
- package/plugins/graphql.mjs +16 -7
- package/plugins/html.d.ts +5 -9
- package/plugins/html.js +19 -17
- package/plugins/html.mjs +19 -17
- package/plugins/markdown.d.ts +4 -8
- package/plugins/markdown.js +54 -33
- package/plugins/markdown.mjs +54 -33
- package/plugins/meriyah.d.ts +2 -6
- package/plugins/meriyah.js +5 -5
- package/plugins/meriyah.mjs +5 -5
- package/plugins/postcss.d.ts +4 -8
- package/plugins/postcss.js +45 -32
- package/plugins/postcss.mjs +45 -32
- package/plugins/typescript.d.ts +2 -6
- package/plugins/typescript.js +24 -20
- package/plugins/typescript.mjs +24 -20
- package/plugins/yaml.d.ts +2 -6
- package/plugins/yaml.js +130 -117
- package/plugins/yaml.mjs +130 -117
- package/standalone.js +27 -90
- package/standalone.mjs +27 -90
- package/plugins/acorn-and-espree.d.ts +0 -10
- package/plugins/acorn-and-espree.js +0 -13
- package/plugins/acorn-and-espree.mjs +0 -13
package/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
// exported module.
|
|
9
9
|
export {};
|
|
10
10
|
|
|
11
|
-
import { builders,
|
|
11
|
+
import { builders, printer, utils } from "./doc.js";
|
|
12
12
|
|
|
13
13
|
export namespace doc {
|
|
14
|
-
export { builders,
|
|
14
|
+
export { builders, printer, utils };
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// This utility is here to handle the case where you have an explicit union
|
|
@@ -477,11 +477,19 @@ export interface Printer<T = any> {
|
|
|
477
477
|
): Doc;
|
|
478
478
|
embed?:
|
|
479
479
|
| ((
|
|
480
|
-
path: AstPath
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
480
|
+
path: AstPath,
|
|
481
|
+
options: Options
|
|
482
|
+
) =>
|
|
483
|
+
| ((
|
|
484
|
+
textToDoc: (text: string, options: Options) => Promise<Doc>,
|
|
485
|
+
print: (
|
|
486
|
+
selector?: string | number | Array<string | number> | AstPath
|
|
487
|
+
) => Doc,
|
|
488
|
+
path: AstPath,
|
|
489
|
+
options: Options
|
|
490
|
+
) => Promise<Doc | undefined> | Doc | undefined)
|
|
491
|
+
| Doc
|
|
492
|
+
| null)
|
|
485
493
|
| undefined;
|
|
486
494
|
insertPragma?: (text: string) => string;
|
|
487
495
|
/**
|
|
@@ -497,6 +505,16 @@ export interface Printer<T = any> {
|
|
|
497
505
|
printComment?:
|
|
498
506
|
| ((commentPath: AstPath<T>, options: ParserOptions<T>) => Doc)
|
|
499
507
|
| undefined;
|
|
508
|
+
/**
|
|
509
|
+
* By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively.
|
|
510
|
+
* This function can be provided to override that behavior.
|
|
511
|
+
* @param node The node whose children should be returned.
|
|
512
|
+
* @param options Current options.
|
|
513
|
+
* @returns `[]` if the node has no children or `undefined` to fall back on the default behavior.
|
|
514
|
+
*/
|
|
515
|
+
getCommentChildNodes?:
|
|
516
|
+
| ((node: T, options: ParserOptions<T>) => T[] | undefined)
|
|
517
|
+
| undefined;
|
|
500
518
|
handleComments?:
|
|
501
519
|
| {
|
|
502
520
|
ownLine?:
|
|
@@ -767,7 +785,7 @@ export interface SupportInfo {
|
|
|
767
785
|
}
|
|
768
786
|
|
|
769
787
|
export interface FileInfoOptions {
|
|
770
|
-
ignorePath?: string | undefined;
|
|
788
|
+
ignorePath?: string | string[] | undefined;
|
|
771
789
|
withNodeModules?: boolean | undefined;
|
|
772
790
|
plugins?: string[] | undefined;
|
|
773
791
|
resolveConfig?: boolean | undefined;
|