Vigia

Aktualizacja prettier z 2.x do 3.x

Porównanie publicznego API prettier 2.8.8 i 3.9.9, obliczone automatycznie na podstawie typów TypeScript. Zmieniona sygnatura to możliwa zmiana niekompatybilna, a nie pewność.

Podsumowanie

Usunięte ścieżki importu12
Usunięte eksporty2
Zmienione sygnatury14
Usunięte składowe klas lub interfejsów16
Zmienione składowe klas lub interfejsów33
Nowo wycofane2
Zmiany wymagań (engines, zależności peer)1
Nowe eksporty1

Usunięte ścieżki importu

Usunięte ścieżki importu
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

Usunięte eksporty

importexportkindPrzed
prettierCustomParsertype(text: string, parsers: BuiltInParsers, options: Options) => any
prettier/docdebugnamespacenamespace

Zmienione sygnatury

exportPrzedPo
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>

Usunięte składowe klas lub interfejsów

memberimportPrzed
Config.pluginSearchDirsprettierfalse | string[] | undefined
Options.pluginSearchDirsprettierfalse | string[] | undefined
CursorOptions.pluginSearchDirsprettierfalse | string[] | undefined
ParserOptions.pluginSearchDirsprettierfalse | string[]
RequiredOptions.pluginSearchDirsprettierfalse | string[]
SupportLanguage.sinceprettierstring | undefined
IntSupportOption.sinceprettierstring
BaseSupportOption.sinceprettierstring
PathSupportOption.sinceprettierstring
ChoiceSupportOption.sinceprettierstring
StringSupportOption.sinceprettierstring
BooleanSupportOption.sinceprettierstring
IntArraySupportOption.sinceprettierstring
PathArraySupportOption.sinceprettierstring
StringArraySupportOption.sinceprettierstring
BooleanArraySupportOption.sinceprettierstring

Zmienione składowe klas lub interfejsów

memberPrzedPo
Config.parserCustomParser | LiteralUnion<BuiltInParserName, string> | undefinedLiteralUnion<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.parserCustomParser | LiteralUnion<BuiltInParserName, string> | undefinedLiteralUnion<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.parserCustomParser | LiteralUnion<BuiltInParserName, string> | undefinedLiteralUnion<BuiltInParserName, string> | undefined
CursorOptions.plugins(string | Plugin<any>)[] | undefined(string | URL | Plugin<any>)[] | undefined
CursorOptions.rangeEndundefinednumber | undefined
CursorOptions.proseWrap"always" | "never" | "preserve" | undefined"preserve" | "always" | "never" | undefined
CursorOptions.rangeStartundefinednumber | undefined
ParserOptions.parserCustomParser | LiteralUnion<BuiltInParserName, string>LiteralUnion<BuiltInParserName, string>
ParserOptions.plugins(string | Plugin<any>)[](string | URL | Plugin<any>)[]
ParserOptions.useTabsbooleanboolean | undefined
ParserOptions.proseWrap"always" | "never" | "preserve""preserve" | "always" | "never"
ParserOptions.jsxBracketSameLinebooleanboolean | undefined
FileInfoOptions.pluginsstring[] | undefined(string | URL | Plugin<any>)[] | undefined
FileInfoOptions.ignorePathstring | undefinedstring | URL | (string | URL)[] | undefined
RequiredOptions.parserCustomParser | LiteralUnion<BuiltInParserName, string>LiteralUnion<BuiltInParserName, string>
RequiredOptions.plugins(string | Plugin<any>)[](string | URL | Plugin<any>)[]
RequiredOptions.useTabsbooleanboolean | undefined
RequiredOptions.proseWrap"always" | "never" | "preserve""preserve" | "always" | "never"
RequiredOptions.jsxBracketSameLinebooleanboolean | undefined
ChoiceSupportOption.choices{ since?: string | undefined; value: Value; description: string; }[]{ value: Value; description: string; }[]
ChoiceSupportOption.defaultValue | { since: string; value: Value; }[] | undefinedValue | { value: Value; }[] | undefined
ResolveConfigOptions.configstring | undefinedstring | URL | undefined

Nowo wycofane

export@deprecated
prettier · AstPath.getNamePlease use `AstPath#key` or `AstPath#index`
prettier · AstPath.getValuePlease use `AstPath#node` or `AstPath#siblings`

Zmiany wymagań (engines, zależności peer)

PrzedPo
engines.node>=10.13.0>=14
Nowe eksporty (1)
importexportkind
prettierSupportInfoOptionsinterface

Najczęściej zadawane pytania

Jakie są zmiany niekompatybilne przy aktualizacji prettier z 2 do 3?

Między prettier 2.8.8 a 3.9.9 Vigia znalazła 2 usuniętych eksportów, 14 zmienionych sygnatur i 49 usuniętych lub zmienionych składowych klas lub interfejsów.

Co zostało wycofane w prettier 3?

2 eksportów lub składowych oznaczono w prettier 3.9.9 jako wycofane.

Dla agentów

GET https://vigia.coredls.cloud/v1/packages/npm/prettier/upgrade?from=2.8.8&to=3.9.9