Vigia

Atualizar prettier de 2.x para 3.x

Comparação da API pública de prettier 2.8.8 e 3.9.9, calculada automaticamente a partir dos tipos TypeScript. Uma assinatura alterada é uma possível mudança incompatível, não uma certeza.

Resumo

Caminhos de importação removidos12
Exports removidos2
Assinaturas alteradas14
Membros de classes ou interfaces removidos16
Membros de classes ou interfaces alterados33
Novas descontinuações2
Mudanças de requisitos (engines, dependências peer)1
Novos exports1

Caminhos de importação removidos

Caminhos de importação removidos
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

Exports removidos

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

Assinaturas alteradas

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

Membros de classes ou interfaces removidos

memberimportAntes
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

Membros de classes ou interfaces alterados

memberAntesDepois
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

Novas descontinuações

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

Mudanças de requisitos (engines, dependências peer)

AntesDepois
engines.node>=10.13.0>=14
Novos exports (1)
importexportkind
prettierSupportInfoOptionsinterface

Perguntas frequentes

Quais são as mudanças incompatíveis ao atualizar prettier de 2 para 3?

Entre prettier 2.8.8 e 3.9.9, o Vigia encontrou 2 exports removidos, 14 assinaturas alteradas e 49 membros de classes ou interfaces removidos ou alterados.

O que foi descontinuado em prettier 3?

2 exports ou membros foram marcados como descontinuados em prettier 3.9.9.

Para agentes

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