Update prettier to 2.3.1 (#13460)
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user