Update checked-in dependencies
This commit is contained in:
parent
49f7b34c3d
commit
5261a1223f
1640 changed files with 174830 additions and 182292 deletions
1489
node_modules/prettier/LICENSE
generated
vendored
1489
node_modules/prettier/LICENSE
generated
vendored
File diff suppressed because it is too large
Load diff
6
node_modules/prettier/README.md
generated
vendored
6
node_modules/prettier/README.md
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||

|
||||
[](https://prettier.io)
|
||||
|
||||
<h2 align="center">Opinionated Code Formatter</h2>
|
||||
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<a href="#badge">
|
||||
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
|
||||
<a href="https://twitter.com/PrettierCode">
|
||||
<img alt="Follow Prettier on Twitter" src="https://img.shields.io/twitter/follow/prettiercode.svg?label=follow+prettier&style=flat-square"></a>
|
||||
<img alt="Follow Prettier on Twitter" src="https://img.shields.io/badge/%40PrettierCode-9f9f9f?style=flat-square&logo=x&labelColor=555"></a>
|
||||
</p>
|
||||
|
||||
## Intro
|
||||
|
|
@ -76,7 +76,7 @@ foo(
|
|||
reallyLongArg(),
|
||||
omgSoManyParameters(),
|
||||
IShouldRefactorThis(),
|
||||
isThereSeriouslyAnotherOne()
|
||||
isThereSeriouslyAnotherOne(),
|
||||
);
|
||||
```
|
||||
|
||||
|
|
|
|||
21
node_modules/prettier/bin/prettier.cjs
generated
vendored
21
node_modules/prettier/bin/prettier.cjs
generated
vendored
|
|
@ -16,14 +16,10 @@ var require_semver_compare = __commonJS({
|
|||
for (var i = 0; i < 3; i++) {
|
||||
var na = Number(pa[i]);
|
||||
var nb = Number(pb[i]);
|
||||
if (na > nb)
|
||||
return 1;
|
||||
if (nb > na)
|
||||
return -1;
|
||||
if (!isNaN(na) && isNaN(nb))
|
||||
return 1;
|
||||
if (isNaN(na) && !isNaN(nb))
|
||||
return -1;
|
||||
if (na > nb) return 1;
|
||||
if (nb > na) return -1;
|
||||
if (!isNaN(na) && isNaN(nb)) return 1;
|
||||
if (isNaN(na) && !isNaN(nb)) return -1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -57,11 +53,16 @@ var require_please_upgrade_node = __commonJS({
|
|||
});
|
||||
|
||||
// bin/prettier.cjs
|
||||
var nodeModule = require("module");
|
||||
if (typeof nodeModule.enableCompileCache === "function") {
|
||||
nodeModule.enableCompileCache();
|
||||
}
|
||||
var pleaseUpgradeNode = require_please_upgrade_node();
|
||||
var packageJson = require("../package.json");
|
||||
pleaseUpgradeNode(packageJson);
|
||||
function runCli(cli) {
|
||||
return cli.run(process.argv.slice(2));
|
||||
return cli.run();
|
||||
}
|
||||
var dynamicImport = new Function("module", "return import(module)");
|
||||
module.exports.promise = dynamicImport("../internal/cli.mjs").then(runCli);
|
||||
var promise = dynamicImport("../internal/cli.mjs").then(runCli);
|
||||
module.exports.__promise = promise;
|
||||
|
|
|
|||
28
node_modules/prettier/doc.d.ts
generated
vendored
28
node_modules/prettier/doc.d.ts
generated
vendored
|
|
@ -38,6 +38,7 @@ export namespace builders {
|
|||
|
||||
interface Group {
|
||||
type: "group";
|
||||
id?: symbol;
|
||||
contents: Doc;
|
||||
break: boolean;
|
||||
expandedStates: Doc[];
|
||||
|
|
@ -64,6 +65,8 @@ export namespace builders {
|
|||
|
||||
interface Label {
|
||||
type: "label";
|
||||
label: any;
|
||||
contents: Doc;
|
||||
}
|
||||
|
||||
interface Line {
|
||||
|
|
@ -137,7 +140,7 @@ export namespace builders {
|
|||
function ifBreak(
|
||||
ifBreak: Doc,
|
||||
noBreak?: Doc,
|
||||
options?: { groupId?: symbol | undefined }
|
||||
options?: { groupId?: symbol | undefined },
|
||||
): IfBreak;
|
||||
|
||||
/** @see [indent](https://github.com/prettier/prettier/blob/main/commands.md#indent) */
|
||||
|
|
@ -146,7 +149,7 @@ export namespace builders {
|
|||
/** @see [indentIfBreak](https://github.com/prettier/prettier/blob/main/commands.md#indentifbreak) */
|
||||
function indentIfBreak(
|
||||
doc: Doc,
|
||||
opts: { groupId: symbol; negate?: boolean | undefined }
|
||||
opts: { groupId: symbol; negate?: boolean | undefined },
|
||||
): IndentIfBreak;
|
||||
|
||||
/** @see [join](https://github.com/prettier/prettier/blob/main/commands.md#join) */
|
||||
|
|
@ -186,10 +189,21 @@ export namespace builders {
|
|||
export namespace printer {
|
||||
function printDocToString(
|
||||
doc: builders.Doc,
|
||||
options: Options
|
||||
options: Options,
|
||||
): {
|
||||
formatted: string;
|
||||
/**
|
||||
* This property is a misnomer, and has been since the changes in
|
||||
* https://github.com/prettier/prettier/pull/15709.
|
||||
* The region of the document indicated by `cursorNodeStart` and `cursorNodeText` will
|
||||
* sometimes actually be what lies BETWEEN a pair of leaf nodes in the AST, rather than a node.
|
||||
*/
|
||||
cursorNodeStart?: number | undefined;
|
||||
|
||||
/**
|
||||
* Note that, like cursorNodeStart, this is a misnomer and may actually be the text between two
|
||||
* leaf nodes in the AST instead of the text of a node.
|
||||
*/
|
||||
cursorNodeText?: string | undefined;
|
||||
};
|
||||
interface Options {
|
||||
|
|
@ -219,22 +233,22 @@ export namespace utils {
|
|||
doc: builders.Doc,
|
||||
onEnter?: (doc: builders.Doc) => void | boolean,
|
||||
onExit?: (doc: builders.Doc) => void,
|
||||
shouldTraverseConditionalGroups?: boolean
|
||||
shouldTraverseConditionalGroups?: boolean,
|
||||
): void;
|
||||
function findInDoc<T = builders.Doc>(
|
||||
doc: builders.Doc,
|
||||
callback: (doc: builders.Doc) => T,
|
||||
defaultValue: T
|
||||
defaultValue: T,
|
||||
): T;
|
||||
function mapDoc<T = builders.Doc>(
|
||||
doc: builders.Doc,
|
||||
callback: (doc: builders.Doc) => T
|
||||
callback: (doc: builders.Doc) => T,
|
||||
): T;
|
||||
function removeLines(doc: builders.Doc): builders.Doc;
|
||||
function stripTrailingHardline(doc: builders.Doc): builders.Doc;
|
||||
function replaceEndOfLine(
|
||||
doc: builders.Doc,
|
||||
replacement?: builders.Doc
|
||||
replacement?: builders.Doc,
|
||||
): builders.Doc;
|
||||
function canBreak(doc: builders.Doc): boolean;
|
||||
}
|
||||
|
|
|
|||
400
node_modules/prettier/doc.js
generated
vendored
400
node_modules/prettier/doc.js
generated
vendored
File diff suppressed because one or more lines are too long
390
node_modules/prettier/doc.mjs
generated
vendored
390
node_modules/prettier/doc.mjs
generated
vendored
File diff suppressed because one or more lines are too long
621
node_modules/prettier/index.cjs
generated
vendored
621
node_modules/prettier/index.cjs
generated
vendored
File diff suppressed because one or more lines are too long
225
node_modules/prettier/index.d.ts
generated
vendored
225
node_modules/prettier/index.d.ts
generated
vendored
|
|
@ -33,15 +33,14 @@ type ArrayElement<T> = T extends Array<infer E> ? E : never;
|
|||
|
||||
// A union of the properties of the given object that are arrays.
|
||||
type ArrayProperties<T> = {
|
||||
[K in keyof T]: NonNullable<T[K]> extends any[] ? K : never;
|
||||
[K in keyof T]: NonNullable<T[K]> extends readonly any[] ? K : never;
|
||||
}[keyof T];
|
||||
|
||||
// A union of the properties of the given array T that can be used to index it.
|
||||
// If the array is a tuple, then that's going to be the explicit indices of the
|
||||
// array, otherwise it's going to just be number.
|
||||
type IndexProperties<T extends { length: number }> = IsTuple<T> extends true
|
||||
? Exclude<Partial<T>["length"], T["length"]>
|
||||
: number;
|
||||
type IndexProperties<T extends { length: number }> =
|
||||
IsTuple<T> extends true ? Exclude<Partial<T>["length"], T["length"]> : number;
|
||||
|
||||
// Effectively performing T[P], except that it's telling TypeScript that it's
|
||||
// safe to do this for tuples, arrays, or objects.
|
||||
|
|
@ -50,8 +49,8 @@ type IndexValue<T, P> = T extends any[]
|
|||
? T[P]
|
||||
: never
|
||||
: P extends keyof T
|
||||
? T[P]
|
||||
: never;
|
||||
? T[P]
|
||||
: never;
|
||||
|
||||
// Determines if an object T is an array like string[] (in which case this
|
||||
// evaluates to false) or a tuple like [string] (in which case this evaluates to
|
||||
|
|
@ -60,8 +59,8 @@ type IndexValue<T, P> = T extends any[]
|
|||
type IsTuple<T> = T extends []
|
||||
? true
|
||||
: T extends [infer First, ...infer Remain]
|
||||
? IsTuple<Remain>
|
||||
: false;
|
||||
? IsTuple<Remain>
|
||||
: false;
|
||||
|
||||
type CallProperties<T> = T extends any[] ? IndexProperties<T> : keyof T;
|
||||
type IterProperties<T> = T extends any[]
|
||||
|
|
@ -72,12 +71,12 @@ type CallCallback<T, U> = (path: AstPath<T>, index: number, value: any) => U;
|
|||
type EachCallback<T> = (
|
||||
path: AstPath<ArrayElement<T>>,
|
||||
index: number,
|
||||
value: any
|
||||
value: any,
|
||||
) => void;
|
||||
type MapCallback<T, U> = (
|
||||
path: AstPath<ArrayElement<T>>,
|
||||
index: number,
|
||||
value: any
|
||||
value: any,
|
||||
) => U;
|
||||
|
||||
// https://github.com/prettier/prettier/blob/next/src/common/ast-path.js
|
||||
|
|
@ -136,18 +135,18 @@ export class AstPath<T = any> {
|
|||
call<U>(callback: CallCallback<T, U>): U;
|
||||
call<U, P1 extends CallProperties<T>>(
|
||||
callback: CallCallback<IndexValue<T, P1>, U>,
|
||||
prop1: P1
|
||||
prop1: P1,
|
||||
): U;
|
||||
call<U, P1 extends keyof T, P2 extends CallProperties<T[P1]>>(
|
||||
callback: CallCallback<IndexValue<IndexValue<T, P1>, P2>, U>,
|
||||
prop1: P1,
|
||||
prop2: P2
|
||||
prop2: P2,
|
||||
): U;
|
||||
call<
|
||||
U,
|
||||
P1 extends keyof T,
|
||||
P2 extends CallProperties<T[P1]>,
|
||||
P3 extends CallProperties<IndexValue<T[P1], P2>>
|
||||
P3 extends CallProperties<IndexValue<T[P1], P2>>,
|
||||
>(
|
||||
callback: CallCallback<
|
||||
IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>,
|
||||
|
|
@ -155,14 +154,14 @@ export class AstPath<T = any> {
|
|||
>,
|
||||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3
|
||||
prop3: P3,
|
||||
): U;
|
||||
call<
|
||||
U,
|
||||
P1 extends keyof T,
|
||||
P2 extends CallProperties<T[P1]>,
|
||||
P3 extends CallProperties<IndexValue<T[P1], P2>>,
|
||||
P4 extends CallProperties<IndexValue<IndexValue<T[P1], P2>, P3>>
|
||||
P4 extends CallProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
|
||||
>(
|
||||
callback: CallCallback<
|
||||
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>,
|
||||
|
|
@ -171,7 +170,7 @@ export class AstPath<T = any> {
|
|||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3,
|
||||
prop4: P4
|
||||
prop4: P4,
|
||||
): U;
|
||||
call<U, P extends PropertyKey>(
|
||||
callback: CallCallback<any, U>,
|
||||
|
|
@ -185,28 +184,28 @@ export class AstPath<T = any> {
|
|||
each(callback: EachCallback<T>): void;
|
||||
each<P1 extends IterProperties<T>>(
|
||||
callback: EachCallback<IndexValue<T, P1>>,
|
||||
prop1: P1
|
||||
prop1: P1,
|
||||
): void;
|
||||
each<P1 extends keyof T, P2 extends IterProperties<T[P1]>>(
|
||||
callback: EachCallback<IndexValue<IndexValue<T, P1>, P2>>,
|
||||
prop1: P1,
|
||||
prop2: P2
|
||||
): void;
|
||||
each<
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>
|
||||
>(
|
||||
callback: EachCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>>,
|
||||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3
|
||||
): void;
|
||||
each<
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>,
|
||||
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>
|
||||
>(
|
||||
callback: EachCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>>,
|
||||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3,
|
||||
): void;
|
||||
each<
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>,
|
||||
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
|
||||
>(
|
||||
callback: EachCallback<
|
||||
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>
|
||||
|
|
@ -214,7 +213,7 @@ export class AstPath<T = any> {
|
|||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3,
|
||||
prop4: P4
|
||||
prop4: P4,
|
||||
): void;
|
||||
each(
|
||||
callback: EachCallback<any[]>,
|
||||
|
|
@ -228,30 +227,30 @@ export class AstPath<T = any> {
|
|||
map<U>(callback: MapCallback<T, U>): U[];
|
||||
map<U, P1 extends IterProperties<T>>(
|
||||
callback: MapCallback<IndexValue<T, P1>, U>,
|
||||
prop1: P1
|
||||
prop1: P1,
|
||||
): U[];
|
||||
map<U, P1 extends keyof T, P2 extends IterProperties<T[P1]>>(
|
||||
callback: MapCallback<IndexValue<IndexValue<T, P1>, P2>, U>,
|
||||
prop1: P1,
|
||||
prop2: P2
|
||||
): U[];
|
||||
map<
|
||||
U,
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>
|
||||
>(
|
||||
callback: MapCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, U>,
|
||||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3
|
||||
): U[];
|
||||
map<
|
||||
U,
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>,
|
||||
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>
|
||||
>(
|
||||
callback: MapCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, U>,
|
||||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3,
|
||||
): U[];
|
||||
map<
|
||||
U,
|
||||
P1 extends keyof T,
|
||||
P2 extends IterProperties<T[P1]>,
|
||||
P3 extends IterProperties<IndexValue<T[P1], P2>>,
|
||||
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
|
||||
>(
|
||||
callback: MapCallback<
|
||||
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>,
|
||||
|
|
@ -260,7 +259,7 @@ export class AstPath<T = any> {
|
|||
prop1: P1,
|
||||
prop2: P2,
|
||||
prop3: P3,
|
||||
prop4: P4
|
||||
prop4: P4,
|
||||
): U[];
|
||||
map<U>(
|
||||
callback: MapCallback<any[], U>,
|
||||
|
|
@ -291,6 +290,7 @@ export type BuiltInParserName =
|
|||
| "json-stringify"
|
||||
| "json"
|
||||
| "json5"
|
||||
| "jsonc"
|
||||
| "less"
|
||||
| "lwc"
|
||||
| "markdown"
|
||||
|
|
@ -302,11 +302,6 @@ export type BuiltInParserName =
|
|||
| "yaml";
|
||||
export type BuiltInParsers = Record<BuiltInParserName, BuiltInParser>;
|
||||
|
||||
export type CustomParser = (
|
||||
text: string,
|
||||
options: Options
|
||||
) => AST | Promise<AST>;
|
||||
|
||||
/**
|
||||
* For use in `.prettierrc.js`, `.prettierrc.cjs`, `prettierrc.mjs`, `prettier.config.js`, `prettier.config.cjs`, `prettier.config.mjs`
|
||||
*/
|
||||
|
|
@ -352,12 +347,6 @@ export interface RequiredOptions extends doc.printer.Options {
|
|||
* @default false
|
||||
*/
|
||||
bracketSameLine: boolean;
|
||||
/**
|
||||
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
|
||||
* @default false
|
||||
* @deprecated use bracketSameLine instead
|
||||
*/
|
||||
jsxBracketSameLine: boolean;
|
||||
/**
|
||||
* Format only a segment of a file.
|
||||
* @default 0
|
||||
|
|
@ -371,7 +360,7 @@ export interface RequiredOptions extends doc.printer.Options {
|
|||
/**
|
||||
* Specify which parser to use.
|
||||
*/
|
||||
parser: LiteralUnion<BuiltInParserName> | CustomParser;
|
||||
parser: LiteralUnion<BuiltInParserName>;
|
||||
/**
|
||||
* Specify the input filepath. This will be used to do parser inference.
|
||||
*/
|
||||
|
|
@ -435,6 +424,22 @@ export interface RequiredOptions extends doc.printer.Options {
|
|||
* @default false
|
||||
*/
|
||||
singleAttributePerLine: boolean;
|
||||
/**
|
||||
* Use curious ternaries, with the question mark after the condition, instead
|
||||
* of on the same line as the consequent.
|
||||
* @default false
|
||||
*/
|
||||
experimentalTernaries: boolean;
|
||||
/**
|
||||
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
|
||||
* @default false
|
||||
* @deprecated use bracketSameLine instead
|
||||
*/
|
||||
jsxBracketSameLine?: boolean;
|
||||
/**
|
||||
* Arbitrary additional values on an options object are always allowed.
|
||||
*/
|
||||
[_: string]: unknown;
|
||||
}
|
||||
|
||||
export interface ParserOptions<T = any> extends RequiredOptions {
|
||||
|
|
@ -467,31 +472,36 @@ export interface Printer<T = any> {
|
|||
path: AstPath<T>,
|
||||
options: ParserOptions<T>,
|
||||
print: (path: AstPath<T>) => Doc,
|
||||
args?: unknown
|
||||
args?: unknown,
|
||||
): Doc;
|
||||
embed?:
|
||||
| ((
|
||||
path: AstPath,
|
||||
options: Options
|
||||
options: Options,
|
||||
) =>
|
||||
| ((
|
||||
textToDoc: (text: string, options: Options) => Promise<Doc>,
|
||||
print: (
|
||||
selector?: string | number | Array<string | number> | AstPath
|
||||
selector?: string | number | Array<string | number> | AstPath,
|
||||
) => Doc,
|
||||
path: AstPath,
|
||||
options: Options
|
||||
options: Options,
|
||||
) => Promise<Doc | undefined> | Doc | undefined)
|
||||
| Doc
|
||||
| null)
|
||||
| undefined;
|
||||
preprocess?:
|
||||
| ((ast: T, options: ParserOptions<T>) => T | Promise<T>)
|
||||
| undefined;
|
||||
insertPragma?: (text: string) => string;
|
||||
/**
|
||||
* @returns `null` if you want to remove this node
|
||||
* @returns `void` if you want to use modified newNode
|
||||
* @returns `void` if you want to use modified `cloned`
|
||||
* @returns anything if you want to replace the node with it
|
||||
*/
|
||||
massageAstNode?: ((node: any, newNode: any, parent: any) => any) | undefined;
|
||||
massageAstNode?:
|
||||
| ((original: any, cloned: any, parent: any) => any)
|
||||
| undefined;
|
||||
hasPrettierIgnore?: ((path: AstPath<T>) => boolean) | undefined;
|
||||
canAttachComment?: ((node: T) => boolean) | undefined;
|
||||
isBlockComment?: ((node: T) => boolean) | undefined;
|
||||
|
|
@ -517,7 +527,7 @@ export interface Printer<T = any> {
|
|||
text: string,
|
||||
options: ParserOptions<T>,
|
||||
ast: T,
|
||||
isLastComment: boolean
|
||||
isLastComment: boolean,
|
||||
) => boolean)
|
||||
| undefined;
|
||||
endOfLine?:
|
||||
|
|
@ -526,7 +536,7 @@ export interface Printer<T = any> {
|
|||
text: string,
|
||||
options: ParserOptions<T>,
|
||||
ast: T,
|
||||
isLastComment: boolean
|
||||
isLastComment: boolean,
|
||||
) => boolean)
|
||||
| undefined;
|
||||
remaining?:
|
||||
|
|
@ -535,11 +545,14 @@ export interface Printer<T = any> {
|
|||
text: string,
|
||||
options: ParserOptions<T>,
|
||||
ast: T,
|
||||
isLastComment: boolean
|
||||
isLastComment: boolean,
|
||||
) => boolean)
|
||||
| undefined;
|
||||
}
|
||||
| undefined;
|
||||
getVisitorKeys?:
|
||||
| ((node: T, nonTraversableKeys: Set<string>) => string[])
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export interface CursorOptions extends Options {
|
||||
|
|
@ -547,8 +560,6 @@ export interface CursorOptions extends Options {
|
|||
* Specify where the cursor is.
|
||||
*/
|
||||
cursorOffset: number;
|
||||
rangeStart?: never;
|
||||
rangeEnd?: never;
|
||||
}
|
||||
|
||||
export interface CursorResult {
|
||||
|
|
@ -571,15 +582,13 @@ export function check(source: string, options?: Options): Promise<boolean>;
|
|||
* `formatWithCursor` both formats the code, and translates a cursor position from unformatted code to formatted code.
|
||||
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted.
|
||||
*
|
||||
* The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`.
|
||||
* The `cursorOffset` option should be provided, to specify where the cursor is.
|
||||
*/
|
||||
export function formatWithCursor(
|
||||
source: string,
|
||||
options: CursorOptions
|
||||
options: CursorOptions,
|
||||
): Promise<CursorResult>;
|
||||
|
||||
export function formatAST(ast: any, options?: Options): Promise<string>;
|
||||
|
||||
export interface ResolveConfigOptions {
|
||||
/**
|
||||
* If set to `false`, all caching will be bypassed.
|
||||
|
|
@ -603,9 +612,8 @@ export interface ResolveConfigOptions {
|
|||
|
||||
/**
|
||||
* `resolveConfig` can be used to resolve configuration for a given source file,
|
||||
* passing its path as the first argument. The config search will start at the
|
||||
* file path and continue to search up the directory.
|
||||
* (You can use `process.cwd()` to start searching from the current directory).
|
||||
* passing its path or url as the first argument. The config search will start at
|
||||
* the directory of the file location and continue to search up the directory.
|
||||
*
|
||||
* A promise is returned which will resolve to:
|
||||
*
|
||||
|
|
@ -615,8 +623,8 @@ export interface ResolveConfigOptions {
|
|||
* The promise will be rejected if there was an error parsing the configuration file.
|
||||
*/
|
||||
export function resolveConfig(
|
||||
filePath: string,
|
||||
options?: ResolveConfigOptions
|
||||
fileUrlOrPath: string | URL,
|
||||
options?: ResolveConfigOptions,
|
||||
): Promise<Options | null>;
|
||||
|
||||
/**
|
||||
|
|
@ -630,7 +638,9 @@ export function resolveConfig(
|
|||
*
|
||||
* The promise will be rejected if there was an error parsing the configuration file.
|
||||
*/
|
||||
export function resolveConfigFile(filePath?: string): Promise<string | null>;
|
||||
export function resolveConfigFile(
|
||||
fileUrlOrPath?: string | URL,
|
||||
): Promise<string | null>;
|
||||
|
||||
/**
|
||||
* As you repeatedly call `resolveConfig`, the file system structure will be cached for performance. This function will clear the cache.
|
||||
|
|
@ -779,9 +789,9 @@ export interface SupportInfo {
|
|||
}
|
||||
|
||||
export interface FileInfoOptions {
|
||||
ignorePath?: string | string[] | undefined;
|
||||
ignorePath?: string | URL | (string | URL)[] | undefined;
|
||||
withNodeModules?: boolean | undefined;
|
||||
plugins?: string[] | undefined;
|
||||
plugins?: Array<string | Plugin> | undefined;
|
||||
resolveConfig?: boolean | undefined;
|
||||
}
|
||||
|
||||
|
|
@ -791,14 +801,21 @@ export interface FileInfoResult {
|
|||
}
|
||||
|
||||
export function getFileInfo(
|
||||
filePath: string,
|
||||
options?: FileInfoOptions
|
||||
file: string | URL,
|
||||
options?: FileInfoOptions,
|
||||
): Promise<FileInfoResult>;
|
||||
|
||||
export interface SupportInfoOptions {
|
||||
plugins?: Array<string | Plugin> | undefined;
|
||||
showDeprecated?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object representing the parsers, languages and file types Prettier supports for the current version.
|
||||
*/
|
||||
export function getSupportInfo(): Promise<SupportInfo>;
|
||||
export function getSupportInfo(
|
||||
options?: SupportInfoOptions,
|
||||
): Promise<SupportInfo>;
|
||||
|
||||
/**
|
||||
* `version` field in `package.json`
|
||||
|
|
@ -820,7 +837,7 @@ export namespace util {
|
|||
function getAlignmentSize(
|
||||
text: string,
|
||||
tabWidth: number,
|
||||
startIndex?: number | undefined
|
||||
startIndex?: number | undefined,
|
||||
): number;
|
||||
|
||||
function getIndentSize(value: string, tabWidth: number): number;
|
||||
|
|
@ -828,83 +845,92 @@ export namespace util {
|
|||
function skipNewline(
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions | undefined
|
||||
options?: SkipOptions | undefined,
|
||||
): 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 skipTrailingComment(
|
||||
text: string,
|
||||
startIndex: number | false
|
||||
startIndex: number | false,
|
||||
): number | false;
|
||||
|
||||
function hasNewline(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
options?: SkipOptions | undefined
|
||||
options?: SkipOptions | undefined,
|
||||
): boolean;
|
||||
|
||||
function hasNewlineInRange(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
endIndex: number
|
||||
endIndex: number,
|
||||
): boolean;
|
||||
|
||||
function hasSpaces(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
options?: SkipOptions | undefined
|
||||
options?: SkipOptions | undefined,
|
||||
): boolean;
|
||||
|
||||
function getNextNonSpaceNonCommentCharacterIndex(
|
||||
text: string,
|
||||
startIndex: number,
|
||||
): number | false;
|
||||
|
||||
function getNextNonSpaceNonCommentCharacter(
|
||||
text: string,
|
||||
startIndex: number
|
||||
startIndex: number,
|
||||
): string;
|
||||
|
||||
function isNextLineEmpty(text: string, startIndex: number): boolean;
|
||||
|
||||
function isPreviousLineEmpty(text: string, startIndex: number): boolean;
|
||||
|
||||
function makeString(
|
||||
rawText: string,
|
||||
enclosingQuote: Quote,
|
||||
unescapeUnnecessaryEscapes?: boolean | undefined
|
||||
unescapeUnnecessaryEscapes?: boolean | undefined,
|
||||
): string;
|
||||
|
||||
function skip(
|
||||
characters: string | RegExp
|
||||
characters: string | RegExp,
|
||||
): (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
const skipWhitespace: (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
const skipSpaces: (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
const skipToLineEnd: (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
const skipEverythingButNewLine: (
|
||||
text: string,
|
||||
startIndex: number | false,
|
||||
options?: SkipOptions
|
||||
options?: SkipOptions,
|
||||
) => number | false;
|
||||
|
||||
function addLeadingComment(node: any, comment: any): void;
|
||||
|
|
@ -912,4 +938,9 @@ export namespace util {
|
|||
function addDanglingComment(node: any, comment: any, marker: any): void;
|
||||
|
||||
function addTrailingComment(node: any, comment: any): void;
|
||||
|
||||
function getPreferredQuote(
|
||||
text: string,
|
||||
preferredQuoteOrPreferSingleQuote: Quote | boolean,
|
||||
): Quote;
|
||||
}
|
||||
|
|
|
|||
24418
node_modules/prettier/index.mjs
generated
vendored
24418
node_modules/prettier/index.mjs
generated
vendored
File diff suppressed because one or more lines are too long
7065
node_modules/prettier/internal/cli.mjs
generated
vendored
7065
node_modules/prettier/internal/cli.mjs
generated
vendored
File diff suppressed because it is too large
Load diff
6531
node_modules/prettier/internal/internal.mjs
generated
vendored
6531
node_modules/prettier/internal/internal.mjs
generated
vendored
File diff suppressed because it is too large
Load diff
11
node_modules/prettier/package.json
generated
vendored
11
node_modules/prettier/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "prettier",
|
||||
"version": "3.0.0",
|
||||
"version": "3.4.1",
|
||||
"description": "Prettier is an opinionated code formatter",
|
||||
"bin": "./bin/prettier.cjs",
|
||||
"repository": "prettier/prettier",
|
||||
|
|
@ -15,6 +15,10 @@
|
|||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"require": "./index.cjs",
|
||||
"browser": {
|
||||
"import": "./standalone.mjs",
|
||||
"default": "./standalone.js"
|
||||
},
|
||||
"default": "./index.mjs"
|
||||
},
|
||||
"./*": "./*",
|
||||
|
|
@ -146,7 +150,6 @@
|
|||
"index.d.ts",
|
||||
"index.mjs",
|
||||
"internal/cli.mjs",
|
||||
"internal/internal.mjs",
|
||||
"package.json",
|
||||
"plugins/acorn.d.ts",
|
||||
"plugins/acorn.js",
|
||||
|
|
@ -190,5 +193,7 @@
|
|||
"standalone.d.ts",
|
||||
"standalone.js",
|
||||
"standalone.mjs"
|
||||
]
|
||||
],
|
||||
"preferUnplugged": true,
|
||||
"type": "commonjs"
|
||||
}
|
||||
26
node_modules/prettier/plugins/acorn.js
generated
vendored
26
node_modules/prettier/plugins/acorn.js
generated
vendored
File diff suppressed because one or more lines are too long
26
node_modules/prettier/plugins/acorn.mjs
generated
vendored
26
node_modules/prettier/plugins/acorn.mjs
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/prettier/plugins/angular.js
generated
vendored
4
node_modules/prettier/plugins/angular.js
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/prettier/plugins/angular.mjs
generated
vendored
4
node_modules/prettier/plugins/angular.mjs
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/prettier/plugins/babel.d.ts
generated
vendored
1
node_modules/prettier/plugins/babel.d.ts
generated
vendored
|
|
@ -13,5 +13,6 @@ export declare const parsers: {
|
|||
__babel_estree: Parser;
|
||||
json: Parser;
|
||||
json5: Parser;
|
||||
jsonc: Parser;
|
||||
"json-stringify": Parser;
|
||||
};
|
||||
|
|
|
|||
23
node_modules/prettier/plugins/babel.js
generated
vendored
23
node_modules/prettier/plugins/babel.js
generated
vendored
File diff suppressed because one or more lines are too long
23
node_modules/prettier/plugins/babel.mjs
generated
vendored
23
node_modules/prettier/plugins/babel.mjs
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/prettier/plugins/estree.d.ts
generated
vendored
1
node_modules/prettier/plugins/estree.d.ts
generated
vendored
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
55
node_modules/prettier/plugins/estree.js
generated
vendored
55
node_modules/prettier/plugins/estree.js
generated
vendored
File diff suppressed because one or more lines are too long
55
node_modules/prettier/plugins/estree.mjs
generated
vendored
55
node_modules/prettier/plugins/estree.mjs
generated
vendored
File diff suppressed because one or more lines are too long
32
node_modules/prettier/plugins/flow.js
generated
vendored
32
node_modules/prettier/plugins/flow.js
generated
vendored
File diff suppressed because one or more lines are too long
32
node_modules/prettier/plugins/flow.mjs
generated
vendored
32
node_modules/prettier/plugins/flow.mjs
generated
vendored
File diff suppressed because one or more lines are too long
46
node_modules/prettier/plugins/glimmer.js
generated
vendored
46
node_modules/prettier/plugins/glimmer.js
generated
vendored
File diff suppressed because one or more lines are too long
46
node_modules/prettier/plugins/glimmer.mjs
generated
vendored
46
node_modules/prettier/plugins/glimmer.mjs
generated
vendored
File diff suppressed because one or more lines are too long
26
node_modules/prettier/plugins/graphql.js
generated
vendored
26
node_modules/prettier/plugins/graphql.js
generated
vendored
File diff suppressed because one or more lines are too long
26
node_modules/prettier/plugins/graphql.mjs
generated
vendored
26
node_modules/prettier/plugins/graphql.mjs
generated
vendored
File diff suppressed because one or more lines are too long
37
node_modules/prettier/plugins/html.js
generated
vendored
37
node_modules/prettier/plugins/html.js
generated
vendored
File diff suppressed because one or more lines are too long
37
node_modules/prettier/plugins/html.mjs
generated
vendored
37
node_modules/prettier/plugins/html.mjs
generated
vendored
File diff suppressed because one or more lines are too long
100
node_modules/prettier/plugins/markdown.js
generated
vendored
100
node_modules/prettier/plugins/markdown.js
generated
vendored
File diff suppressed because one or more lines are too long
100
node_modules/prettier/plugins/markdown.mjs
generated
vendored
100
node_modules/prettier/plugins/markdown.mjs
generated
vendored
File diff suppressed because one or more lines are too long
9
node_modules/prettier/plugins/meriyah.js
generated
vendored
9
node_modules/prettier/plugins/meriyah.js
generated
vendored
File diff suppressed because one or more lines are too long
9
node_modules/prettier/plugins/meriyah.mjs
generated
vendored
9
node_modules/prettier/plugins/meriyah.mjs
generated
vendored
File diff suppressed because one or more lines are too long
88
node_modules/prettier/plugins/postcss.js
generated
vendored
88
node_modules/prettier/plugins/postcss.js
generated
vendored
File diff suppressed because one or more lines are too long
88
node_modules/prettier/plugins/postcss.mjs
generated
vendored
88
node_modules/prettier/plugins/postcss.mjs
generated
vendored
File diff suppressed because one or more lines are too long
37
node_modules/prettier/plugins/typescript.js
generated
vendored
37
node_modules/prettier/plugins/typescript.js
generated
vendored
File diff suppressed because one or more lines are too long
37
node_modules/prettier/plugins/typescript.mjs
generated
vendored
37
node_modules/prettier/plugins/typescript.mjs
generated
vendored
File diff suppressed because one or more lines are too long
122
node_modules/prettier/plugins/yaml.js
generated
vendored
122
node_modules/prettier/plugins/yaml.js
generated
vendored
File diff suppressed because one or more lines are too long
122
node_modules/prettier/plugins/yaml.mjs
generated
vendored
122
node_modules/prettier/plugins/yaml.mjs
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/prettier/standalone.d.ts
generated
vendored
4
node_modules/prettier/standalone.d.ts
generated
vendored
|
|
@ -4,7 +4,7 @@ import { CursorOptions, CursorResult, Options, SupportInfo } from "./index.js";
|
|||
* formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code.
|
||||
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted
|
||||
*
|
||||
* The cursorOffset option should be provided, to specify where the cursor is. This option cannot be used with rangeStart and rangeEnd.
|
||||
* The cursorOffset option should be provided, to specify where the cursor is.
|
||||
*
|
||||
* ```js
|
||||
* await prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
|
||||
|
|
@ -13,7 +13,7 @@ import { CursorOptions, CursorResult, Options, SupportInfo } from "./index.js";
|
|||
*/
|
||||
export function formatWithCursor(
|
||||
source: string,
|
||||
options: CursorOptions
|
||||
options: CursorOptions,
|
||||
): Promise<CursorResult>;
|
||||
|
||||
/**
|
||||
|
|
|
|||
71
node_modules/prettier/standalone.js
generated
vendored
71
node_modules/prettier/standalone.js
generated
vendored
File diff suppressed because one or more lines are too long
71
node_modules/prettier/standalone.mjs
generated
vendored
71
node_modules/prettier/standalone.mjs
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue