File tree 1 file changed +5
-13
lines changed
1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -156,20 +156,12 @@ function getPluginVersion(name: string): string | null {
156
156
157
157
async function getPlugins ( names : string [ ] ) : Promise < PrettierPlugin [ ] > {
158
158
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 ) ) ) ;
164
160
}
165
161
166
162
async function getPluginsOrExit ( names : string [ ] ) : Promise < PrettierPlugin [ ] > {
167
163
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 ) ) ) ;
173
165
}
174
166
175
167
const getPluginsBuiltin = once ( async ( ) : Promise < PrettierPlugin [ ] > => {
@@ -529,9 +521,9 @@ function normalizeFormatOptions(options: unknown): FormatOptions {
529
521
530
522
if ( "parser" in options ) {
531
523
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" ] ;
535
527
}
536
528
}
537
529
You can’t perform that action at this time.
0 commit comments