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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 15 deletions

View File

@ -61,7 +61,7 @@
"lint-staged": "^9.2.0", "lint-staged": "^9.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mergeiterator": "^1.2.5", "mergeiterator": "^1.2.5",
"prettier": "2.3.0", "prettier": "2.3.1",
"rollup": "^2.47.0", "rollup": "^2.47.0",
"rollup-plugin-dts": "^2.0.0", "rollup-plugin-dts": "^2.0.0",
"rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-node-polyfills": "^0.2.1",

View File

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

View File

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

View File

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

View File

@ -5773,7 +5773,7 @@ __metadata:
lint-staged: ^9.2.0 lint-staged: ^9.2.0
lodash: ^4.17.21 lodash: ^4.17.21
mergeiterator: ^1.2.5 mergeiterator: ^1.2.5
prettier: 2.3.0 prettier: 2.3.1
rollup: ^2.47.0 rollup: ^2.47.0
rollup-plugin-dts: ^2.0.0 rollup-plugin-dts: ^2.0.0
rollup-plugin-node-polyfills: ^0.2.1 rollup-plugin-node-polyfills: ^0.2.1
@ -12605,12 +12605,12 @@ fsevents@^1.2.7:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:2.3.0": "prettier@npm:2.3.1":
version: 2.3.0 version: 2.3.1
resolution: "prettier@npm:2.3.0" resolution: "prettier@npm:2.3.1"
bin: bin:
prettier: bin-prettier.js prettier: bin-prettier.js
checksum: 652640cc8b71bc5277cfb8bf6f161783ca588efcf683c3d630837b39da8d57fef35c9e00ae5855a8e3c75136c42274046c913cc2b2d2968558315f31c6a26981 checksum: 9b4a695b87ce5f510fc20feec01cce7371f0fa0b92ffe79d543f6be52e2004c532861629de4d7ab1c577e1f649dce3cfccd62cb2ca6526b1da8d9c63eb84bf36
languageName: node languageName: node
linkType: hard linkType: hard