File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,20 +156,12 @@ function getPluginVersion(name: string): string | null {
156156
157157async function getPlugins ( names : string [ ] ) : Promise < PrettierPlugin [ ] > {
158158 if ( ! names . length ) return [ ] ;
159- return (
160- await Promise . all (
161- names . map ( ( name ) => getPlugin ( name ) )
162- )
163- ) ;
159+ return await Promise . all ( names . map ( ( name ) => getPlugin ( name ) ) ) ;
164160}
165161
166162async function getPluginsOrExit ( names : string [ ] ) : Promise < PrettierPlugin [ ] > {
167163 if ( ! names . length ) return [ ] ;
168- return (
169- await Promise . all (
170- names . map ( ( name ) => getPluginOrExit ( name ) )
171- )
172- ) ;
164+ return await Promise . all ( names . map ( ( name ) => getPluginOrExit ( name ) ) ) ;
173165}
174166
175167const getPluginsBuiltin = once ( async ( ) : Promise < PrettierPlugin [ ] > => {
@@ -529,9 +521,9 @@ function normalizeFormatOptions(options: unknown): FormatOptions {
529521
530522 if ( "parser" in options ) {
531523 const value = options . parser ;
532- // prettier-ignore
533- if ( value === "flow" || value === "babel" || value === "babel-flow" || value === "babel-ts" || value === "typescript" || value === "acorn" || value === "espree" || value === "meriyah" || value === "css" || value === "less" || value === "scss" || value === "json" || value === "json5" || value === "json-stringify" || value === "graphql" || value === "markdown" || value === "mdx" || value === "vue" || value === "yaml" || value === "glimmer" || value === "html" || value === "angular" || value === "lwc" ) {
534- formatOptions . parser = value ;
524+ if ( isString ( value ) ) {
525+ // New parsers that we don't about can be added by plugins
526+ formatOptions . parser = value as FormatOptions [ "parser" ] ;
535527 }
536528 }
537529
You can’t perform that action at this time.
0 commit comments