prettier को 2.x से 3.x पर अपग्रेड करना
prettier 2.8.8 और 3.9.9 के सार्वजनिक API की तुलना, उनके TypeScript टाइप से अपने-आप निकाली गई। बदला हुआ सिग्नेचर संभावित असंगत बदलाव है, निश्चितता नहीं।
सारांश
| हटाए गए इम्पोर्ट पाथ | 12 |
|---|---|
| हटाए गए एक्सपोर्ट | 2 |
| बदले गए सिग्नेचर | 14 |
| क्लास या इंटरफ़ेस के हटाए गए सदस्य | 16 |
| क्लास या इंटरफ़ेस के बदले गए सदस्य | 33 |
| नए डिप्रिकेटेड | 2 |
| आवश्यकताओं में बदलाव (engines, peer निर्भरताएँ) | 1 |
| नए एक्सपोर्ट | 1 |
हटाए गए इम्पोर्ट पाथ
| हटाए गए इम्पोर्ट पाथ |
|---|
prettier/parser-flow |
prettier/parser-html |
prettier/parser-yaml |
prettier/parser-babel |
prettier/parser-espree |
prettier/parser-angular |
prettier/parser-glimmer |
prettier/parser-graphql |
prettier/parser-meriyah |
prettier/parser-postcss |
prettier/parser-markdown |
prettier/parser-typescript |
हटाए गए एक्सपोर्ट
| import | export | kind | पहले |
|---|---|---|---|
prettier | CustomParser | type | (text: string, parsers: BuiltInParsers, options: Options) => any |
prettier/doc | debug | namespace | namespace |
बदले गए सिग्नेचर
| export | पहले | बाद में |
|---|---|---|
prettier · check | (source: string, options?: Options | undefined): boolean | (source: string, options?: Options | undefined): Promise<boolean> |
prettier · format | (source: string, options?: Options | undefined): string | (source: string, options?: Options | undefined): Promise<string> |
prettier · getFileInfo | (filePath: string, options?: FileInfoOptions | undefined): Promise<FileInfoResult> | (file: string | URL, options?: FileInfoOptions | undefined): Promise<FileInfoResult> |
prettier · resolveConfig | (filePath: string, options?: ResolveConfigOptions | undefined): Promise<Options | null> | (fileUrlOrPath: string | URL, options?: ResolveConfigOptions | undefined): Promise<Options | null> |
prettier · BuiltInParsers | { angular: BuiltInParser; "babel-flow": BuiltInParser; "babel-ts": BuiltInParser; babel: BuiltInParser; css: BuiltInParser; espree: BuiltInParser; flow: BuiltInParser; glimmer: BuiltInParser; graphql: BuiltInParser; html: BuiltInParser; "json-stringify": BuiltInParser; json: BuiltInParser; json5: BuiltInParser; less: BuiltInParser; lwc: BuiltInParser; markdown: BuiltInParser; mdx: BuiltInParser; meriyah: BuiltInParser; scss: BuiltInParser; typescript: BuiltInParser; vue: BuiltInParser; yaml: BuiltInParser; } | { acorn: BuiltInParser; angular: BuiltInParser; "babel-flow": BuiltInParser; "babel-ts": BuiltInParser; babel: BuiltInParser; css: BuiltInParser; espree: BuiltInParser; flow: BuiltInParser; glimmer: BuiltInParser; graphql: BuiltInParser; html: BuiltInParser; "json-stringify": BuiltInParser; json: BuiltInParser; json5: BuiltInParser; jsonc: BuiltInParser; less: BuiltInParser; lwc: BuiltInParser; markdown: BuiltInParser; mdx: BuiltInParser; meriyah: BuiltInParser; mjml: BuiltInParser; scss: BuiltInParser; typescript: BuiltInParser; vue: BuiltInParser; yaml: BuiltInParser; } |
prettier · getSupportInfo | (): SupportInfo | (options?: SupportInfoOptions | undefined): Promise<SupportInfo> |
prettier · clearConfigCache | (): void | (): Promise<void> |
prettier · formatWithCursor | (source: string, options: CursorOptions): CursorResult | (source: string, options: CursorOptions): Promise<CursorResult> |
prettier · BuiltInParserName | "angular" | "babel-flow" | "babel-ts" | "babel" | "css" | "espree" | "flow" | "glimmer" | "graphql" | "html" | "json-stringify" | "json" | "json5" | "less" | "lwc" | "markdown" | "mdx" | "meriyah" | "scss" | "typescript" | "vue" | "yaml" | "acorn" | "angular" | "babel-flow" | "babel-ts" | "babel" | "css" | "espree" | "flow" | "glimmer" | "graphql" | "html" | "json-stringify" | "json" | "json5" | "jsonc" | "less" | "lwc" | "markdown" | "mdx" | "meriyah" | "mjml" | "scss" | "typescript" | "vue" | "yaml" |
prettier · resolveConfigFile | (filePath?: string | undefined): Promise<string | null> | (fileUrlOrPath?: string | URL | undefined): Promise<string | null> |
prettier/standalone · check | (source: string, options?: Options | undefined): boolean | (source: string, options?: Options | undefined): Promise<boolean> |
prettier/standalone · format | (source: string, options?: Options | undefined): string | (source: string, options?: Options | undefined): Promise<string> |
prettier/standalone · getSupportInfo | (): SupportInfo | (): Promise<SupportInfo> |
prettier/standalone · formatWithCursor | (source: string, options: CursorOptions): CursorResult | (source: string, options: CursorOptions): Promise<CursorResult> |
क्लास या इंटरफ़ेस के हटाए गए सदस्य
| member | import | पहले |
|---|---|---|
Config.pluginSearchDirs | prettier | false | string[] | undefined |
Options.pluginSearchDirs | prettier | false | string[] | undefined |
CursorOptions.pluginSearchDirs | prettier | false | string[] | undefined |
ParserOptions.pluginSearchDirs | prettier | false | string[] |
RequiredOptions.pluginSearchDirs | prettier | false | string[] |
SupportLanguage.since | prettier | string | undefined |
IntSupportOption.since | prettier | string |
BaseSupportOption.since | prettier | string |
PathSupportOption.since | prettier | string |
ChoiceSupportOption.since | prettier | string |
StringSupportOption.since | prettier | string |
BooleanSupportOption.since | prettier | string |
IntArraySupportOption.since | prettier | string |
PathArraySupportOption.since | prettier | string |
StringArraySupportOption.since | prettier | string |
BooleanArraySupportOption.since | prettier | string |
क्लास या इंटरफ़ेस के बदले गए सदस्य
| member | पहले | बाद में |
|---|---|---|
Config.parser | CustomParser | LiteralUnion<BuiltInParserName, string> | undefined | LiteralUnion<BuiltInParserName, string> | undefined |
Config.plugins | (string | Plugin<any>)[] | undefined | (string | URL | Plugin<any>)[] | undefined |
Config.proseWrap | "always" | "never" | "preserve" | undefined | "preserve" | "always" | "never" | undefined |
Parser.parse | (text: string, parsers: { [parserName: string]: Parser<any>; }, options: ParserOptions<T>): T | (text: string, options: ParserOptions<T>): T | Promise<T> |
Parser.preprocess | ((text: string, options: ParserOptions<T>) => string) | undefined | ((text: string, options: ParserOptions<T>) => string | Promise<string>) | undefined |
Options.parser | CustomParser | LiteralUnion<BuiltInParserName, string> | undefined | LiteralUnion<BuiltInParserName, string> | undefined |
Options.plugins | (string | Plugin<any>)[] | undefined | (string | URL | Plugin<any>)[] | undefined |
Options.proseWrap | "always" | "never" | "preserve" | undefined | "preserve" | "always" | "never" | undefined |
Printer.embed | ((path: AstPath<T>, print: (path: AstPath<T>) => Doc, textToDoc: (text: string, options: Options) => Doc, options: ParserOptions<T>) => Doc | null) | undefined | ((path: AstPath<any>, options: Options) => Doc | ((textToDoc: (text: string, options: Options) => Promise<Doc>, print: (selector?: string | number | (string | number)[] | AstPath<any> | undefined, args?: unknown) => Doc, path: AstPath<any>, options: Options) => Doc | Promise<Doc | undefined> | undef… |
Printer.print | (path: AstPath<T>, options: ParserOptions<T>, print: (path: AstPath<T>) => Doc, args?: unknown): Doc | (path: AstPath<T>, options: ParserOptions<T>, print: (selector?: string | number | AstPath<T> | (string | number)[] | undefined, args?: unknown) => Doc, args?: unknown): Doc |
Printer.preprocess | ((ast: any, options: ParserOptions<T>) => any) | undefined | ((ast: T, options: ParserOptions<T>) => T | Promise<T>) | undefined |
Printer.massageAstNode | ((node: any, newNode: any, parent: any) => any) | undefined | ((original: any, cloned: any, parent: any) => any) | undefined |
Printer.canAttachComment | ((node: T) => boolean) | undefined | ((node: T, ancestors: T[]) => boolean) | undefined |
CursorOptions.parser | CustomParser | LiteralUnion<BuiltInParserName, string> | undefined | LiteralUnion<BuiltInParserName, string> | undefined |
CursorOptions.plugins | (string | Plugin<any>)[] | undefined | (string | URL | Plugin<any>)[] | undefined |
CursorOptions.rangeEnd | undefined | number | undefined |
CursorOptions.proseWrap | "always" | "never" | "preserve" | undefined | "preserve" | "always" | "never" | undefined |
CursorOptions.rangeStart | undefined | number | undefined |
ParserOptions.parser | CustomParser | LiteralUnion<BuiltInParserName, string> | LiteralUnion<BuiltInParserName, string> |
ParserOptions.plugins | (string | Plugin<any>)[] | (string | URL | Plugin<any>)[] |
ParserOptions.useTabs | boolean | boolean | undefined |
ParserOptions.proseWrap | "always" | "never" | "preserve" | "preserve" | "always" | "never" |
ParserOptions.jsxBracketSameLine | boolean | boolean | undefined |
FileInfoOptions.plugins | string[] | undefined | (string | URL | Plugin<any>)[] | undefined |
FileInfoOptions.ignorePath | string | undefined | string | URL | (string | URL)[] | undefined |
RequiredOptions.parser | CustomParser | LiteralUnion<BuiltInParserName, string> | LiteralUnion<BuiltInParserName, string> |
RequiredOptions.plugins | (string | Plugin<any>)[] | (string | URL | Plugin<any>)[] |
RequiredOptions.useTabs | boolean | boolean | undefined |
RequiredOptions.proseWrap | "always" | "never" | "preserve" | "preserve" | "always" | "never" |
RequiredOptions.jsxBracketSameLine | boolean | boolean | undefined |
ChoiceSupportOption.choices | { since?: string | undefined; value: Value; description: string; }[] | { value: Value; description: string; }[] |
ChoiceSupportOption.default | Value | { since: string; value: Value; }[] | undefined | Value | { value: Value; }[] | undefined |
ResolveConfigOptions.config | string | undefined | string | URL | undefined |
नए डिप्रिकेटेड
| export | @deprecated |
|---|---|
prettier · AstPath.getName | Please use `AstPath#key` or `AstPath#index` |
prettier · AstPath.getValue | Please use `AstPath#node` or `AstPath#siblings` |
आवश्यकताओं में बदलाव (engines, peer निर्भरताएँ)
| पहले | बाद में | |
|---|---|---|
engines.node | >=10.13.0 | >=14 |
नए एक्सपोर्ट (1)
| import | export | kind |
|---|---|---|
prettier | SupportInfoOptions | interface |
अक्सर पूछे जाने वाले प्रश्न
prettier को 2 से 3 पर अपग्रेड करने पर कौन-से असंगत बदलाव हैं?
prettier 2.8.8 और 3.9.9 के बीच Vigia को 2 हटाए गए एक्सपोर्ट, 14 बदले गए सिग्नेचर और 49 हटाए या बदले गए क्लास/इंटरफ़ेस सदस्य मिले।
prettier 3 में क्या डिप्रिकेट हुआ?
prettier 3.9.9 में 2 एक्सपोर्ट या सदस्य नए रूप से डिप्रिकेटेड चिह्नित हैं।
एजेंटों के लिए
GET https://vigia.coredls.cloud/v1/packages/npm/prettier/upgrade?from=2.8.8&to=3.9.9