Vigia

prettier을(를) 2.x에서 3.x로 업그레이드하기

prettier 2.8.8과 3.9.9의 공개 API를 TypeScript 타입에서 자동으로 비교한 결과입니다. 시그니처 변경은 호환성이 깨질 가능성이 있다는 뜻이며 확정은 아닙니다.

요약

삭제된 import 경로12
삭제된 export2
변경된 시그니처14
삭제된 클래스·인터페이스 멤버16
변경된 클래스·인터페이스 멤버33
새로 지원 중단됨2
요구 사항 변경 (engines, peer 의존성)1
새 export1

삭제된 import 경로

삭제된 import 경로
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

삭제된 export

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

변경된 시그니처

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>

삭제된 클래스·인터페이스 멤버

memberimport이전
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

변경된 클래스·인터페이스 멤버

member이전이후
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

새로 지원 중단됨

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

요구 사항 변경 (engines, peer 의존성)

이전이후
engines.node>=10.13.0>=14
새 export (1)
importexportkind
prettierSupportInfoOptionsinterface

자주 묻는 질문

prettier을(를) 2에서 3(으)로 업그레이드할 때 호환성이 깨지는 변경은 무엇인가요?

prettier 2.8.8과 3.9.9 사이에서 Vigia는 삭제된 export 2개, 변경된 시그니처 14개, 삭제되거나 변경된 클래스·인터페이스 멤버 49개를 찾았습니다.

prettier 3에서 지원 중단된 것은 무엇인가요?

prettier 3.9.9에서 export 또는 멤버 2개가 새로 지원 중단으로 표시되었습니다.

에이전트용

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