Update prettier to 2.3.1 (#13460)

This commit is contained in:
Sosuke Suzuki
2021-06-15 00:33:58 +09:00
committed by GitHub
parent 66cbd6091e
commit ad693cc0a0
5 changed files with 25 additions and 15 deletions

View File

@@ -717,8 +717,10 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
function dedupDescriptors(
items: Array<UnloadedDescriptor>,
): Array<UnloadedDescriptor> {
const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
new Map();
const map: Map<
Function,
Map<string | void, { value: UnloadedDescriptor }>
> = new Map();
const descriptors = [];

View File

@@ -283,10 +283,14 @@ const makeDescriptorLoader = <Context, API>(
return { value: item, options, dirname, alias };
});
const pluginDescriptorLoader =
makeDescriptorLoader<Context.SimplePlugin, PluginAPI>(makePluginAPI);
const presetDescriptorLoader =
makeDescriptorLoader<Context.SimplePreset, PresetAPI>(makePresetAPI);
const pluginDescriptorLoader = makeDescriptorLoader<
Context.SimplePlugin,
PluginAPI
>(makePluginAPI);
const presetDescriptorLoader = makeDescriptorLoader<
Context.SimplePreset,
PresetAPI
>(makePresetAPI);
/**
* Instantiate a plugin for the given descriptor, returning the plugin/options pair.

View File

@@ -68,9 +68,13 @@ function handleVariableDeclaration(
}
const { declarations } = node;
if (
declarations.every((declarator): declarator is t.VariableDeclarator & {
id: t.Identifier;
} => t.isIdentifier(declarator.id))
declarations.every(
(
declarator,
): declarator is t.VariableDeclarator & {
id: t.Identifier;
} => t.isIdentifier(declarator.id),
)
) {
// `export const a = 1` transforms to `const a = N.a = 1`, the output
// is smaller than `const a = 1; N.a = a`;