Skip to content

Commit 915c6f2

Browse files
chore(deps): update dependency prettier to v2.8.7 (#729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Sarah Dayan <[email protected]>
1 parent 8422712 commit 915c6f2

File tree

30 files changed

+359
-460
lines changed

30 files changed

+359
-460
lines changed

examples/github-notification-filters/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ autocomplete<AutocompleteItem>({
7777
sourceId: 'query',
7878
onSelect() {
7979
const params = Object.fromEntries(
80-
Object.entries(
81-
groupBy(allTags, ({ token }) => token)
82-
).map(([key, entries]) => [key, entries.map(({ value }) => value)])
80+
Object.entries(groupBy(allTags, ({ token }) => token)).map(
81+
([key, entries]) => [key, entries.map(({ value }) => value)]
82+
)
8383
);
8484

8585
window.location.assign(

examples/playground/shortcutsPlugin.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export const shortcutsPlugin: AutocompletePlugin<DarkModeItem, undefined> = {
5454
strokeLinecap: 'round',
5555
strokeLinejoin: 'round',
5656
strokeWidth: 2,
57-
d:
58-
'M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z',
57+
d: 'M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z',
5958
})
6059
);
6160
const lightIcon = createElement(
@@ -70,8 +69,7 @@ export const shortcutsPlugin: AutocompletePlugin<DarkModeItem, undefined> = {
7069
strokeLinecap: 'round',
7170
strokeLinejoin: 'round',
7271
strokeWidth: 2,
73-
d:
74-
'M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z',
72+
d: 'M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z',
7573
})
7674
);
7775

examples/recently-viewed-items/recentlyViewedItemsPlugin.tsx

Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -46,88 +46,84 @@ export function createLocalStorageRecentlyViewedItems<
4646
>(
4747
params: CreateLocalStorageRecentlyViewedItemsParams<TItem>
4848
): AutocompletePlugin<TItem, RecentlyViewedItemsPluginData<TItem>> {
49-
const {
50-
onReset,
51-
onSubmit,
52-
subscribe,
53-
...plugin
54-
} = createLocalStorageRecentSearchesPlugin<TItem>({
55-
...params,
56-
search(params) {
57-
if (params.query) {
58-
return [];
59-
}
49+
const { onReset, onSubmit, subscribe, ...plugin } =
50+
createLocalStorageRecentSearchesPlugin<TItem>({
51+
...params,
52+
search(params) {
53+
if (params.query) {
54+
return [];
55+
}
6056

61-
return search(params);
62-
},
63-
transformSource({ source, onRemove, state }) {
64-
const transformedSource = params.transformSource
65-
? params.transformSource({ source, onRemove, state })
66-
: source;
57+
return search(params);
58+
},
59+
transformSource({ source, onRemove, state }) {
60+
const transformedSource = params.transformSource
61+
? params.transformSource({ source, onRemove, state })
62+
: source;
6763

68-
return {
69-
...transformedSource,
70-
getItemUrl({ item }) {
71-
return item.url;
72-
},
73-
templates: {
74-
...transformedSource.templates,
75-
header() {
76-
return (
77-
<Fragment>
78-
<span className="aa-SourceHeaderTitle">Recently viewed</span>
79-
<div className="aa-SourceHeaderLine" />
80-
</Fragment>
81-
);
64+
return {
65+
...transformedSource,
66+
getItemUrl({ item }) {
67+
return item.url;
8268
},
83-
item({ item, components }) {
84-
return (
85-
<a className="aa-ItemLink" href={item.url}>
86-
<div className="aa-ItemContent">
87-
{item.image ? (
88-
<div className="aa-ItemIcon">
89-
<img src={item.image} alt={item.label} />
90-
</div>
91-
) : (
92-
<div className="aa-ItemIcon aa-ItemIcon--noBorder">
93-
<svg viewBox="0 0 24 24" fill="currentColor">
94-
<path d="M12.516 6.984v5.25l4.5 2.672-0.75 1.266-5.25-3.188v-6h1.5zM12 20.016q3.281 0 5.648-2.367t2.367-5.648-2.367-5.648-5.648-2.367-5.648 2.367-2.367 5.648 2.367 5.648 5.648 2.367zM12 2.016q4.125 0 7.055 2.93t2.93 7.055-2.93 7.055-7.055 2.93-7.055-2.93-2.93-7.055 2.93-7.055 7.055-2.93z" />
95-
</svg>
96-
</div>
97-
)}
98-
<div className="aa-ItemContentBody">
99-
<div className="aa-ItemContentTitle">
100-
<components.Highlight hit={item} attribute="label" />
69+
templates: {
70+
...transformedSource.templates,
71+
header() {
72+
return (
73+
<Fragment>
74+
<span className="aa-SourceHeaderTitle">Recently viewed</span>
75+
<div className="aa-SourceHeaderLine" />
76+
</Fragment>
77+
);
78+
},
79+
item({ item, components }) {
80+
return (
81+
<a className="aa-ItemLink" href={item.url}>
82+
<div className="aa-ItemContent">
83+
{item.image ? (
84+
<div className="aa-ItemIcon">
85+
<img src={item.image} alt={item.label} />
86+
</div>
87+
) : (
88+
<div className="aa-ItemIcon aa-ItemIcon--noBorder">
89+
<svg viewBox="0 0 24 24" fill="currentColor">
90+
<path d="M12.516 6.984v5.25l4.5 2.672-0.75 1.266-5.25-3.188v-6h1.5zM12 20.016q3.281 0 5.648-2.367t2.367-5.648-2.367-5.648-5.648-2.367-5.648 2.367-2.367 5.648 2.367 5.648 5.648 2.367zM12 2.016q4.125 0 7.055 2.93t2.93 7.055-2.93 7.055-7.055 2.93-7.055-2.93-2.93-7.055 2.93-7.055 7.055-2.93z" />
91+
</svg>
92+
</div>
93+
)}
94+
<div className="aa-ItemContentBody">
95+
<div className="aa-ItemContentTitle">
96+
<components.Highlight hit={item} attribute="label" />
97+
</div>
10198
</div>
10299
</div>
103-
</div>
104-
<div className="aa-ItemActions">
105-
<button
106-
className="aa-ItemActionButton"
107-
title="Remove this search"
108-
onClick={(event) => {
109-
event.preventDefault();
110-
event.stopPropagation();
111-
onRemove(item.id);
112-
}}
113-
>
114-
<svg
115-
viewBox="0 0 24 24"
116-
width="18"
117-
height="18"
118-
fill="currentColor"
100+
<div className="aa-ItemActions">
101+
<button
102+
className="aa-ItemActionButton"
103+
title="Remove this search"
104+
onClick={(event) => {
105+
event.preventDefault();
106+
event.stopPropagation();
107+
onRemove(item.id);
108+
}}
119109
>
120-
<path d="M18 7v13c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-10c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-13zM17 5v-1c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-4c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v1h-4c-0.552 0-1 0.448-1 1s0.448 1 1 1h1v13c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h10c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-13h1c0.552 0 1-0.448 1-1s-0.448-1-1-1zM9 5v-1c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293h4c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v1zM9 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1zM13 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1z" />
121-
</svg>
122-
</button>
123-
</div>
124-
</a>
125-
);
110+
<svg
111+
viewBox="0 0 24 24"
112+
width="18"
113+
height="18"
114+
fill="currentColor"
115+
>
116+
<path d="M18 7v13c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-10c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-13zM17 5v-1c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-4c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v1h-4c-0.552 0-1 0.448-1 1s0.448 1 1 1h1v13c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h10c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-13h1c0.552 0 1-0.448 1-1s-0.448-1-1-1zM9 5v-1c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293h4c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v1zM9 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1zM13 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1z" />
117+
</svg>
118+
</button>
119+
</div>
120+
</a>
121+
);
122+
},
126123
},
127-
},
128-
};
129-
},
130-
});
124+
};
125+
},
126+
});
131127
const { getAlgoliaSearchParams, ...data } = plugin.data;
132128

133129
return {

examples/reshape/app.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ autocomplete({
5959
openOnFocus: true,
6060
plugins: [recentSearchesPlugin, querySuggestionsPlugin, productsPlugin],
6161
reshape({ sourcesBySourceId }) {
62-
const {
63-
recentSearchesPlugin,
64-
querySuggestionsPlugin,
65-
products,
66-
...rest
67-
} = sourcesBySourceId;
62+
const { recentSearchesPlugin, querySuggestionsPlugin, products, ...rest } =
63+
sourcesBySourceId;
6864

6965
return [
7066
dedupeAndLimitSuggestions(recentSearchesPlugin, querySuggestionsPlugin),

examples/two-column-layout/src/functions/createFillWith.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ type createFillWithOptions = {
99

1010
// This reshape function computes the total number of source items and
1111
// limits the provided main source number of items until it reaches the provided limit.
12-
export const createFillWith: AutocompleteReshapeFunction<createFillWithOptions> = ({
13-
mainSourceId,
14-
limit,
15-
}) => {
12+
export const createFillWith: AutocompleteReshapeFunction<
13+
createFillWithOptions
14+
> = ({ mainSourceId, limit }) => {
1615
return function runUniqBy(...rawSources) {
1716
const originalSources = normalizeReshapeSources(rawSources);
1817
const otherSources = originalSources.filter(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"postcss-color-rgb": "2.0.0",
7272
"postcss-comment": "2.0.0",
7373
"postcss-preset-env": "6.7.1",
74-
"prettier": "2.2.1",
74+
"prettier": "2.8.7",
7575
"rollup": "2.79.1",
7676
"rollup-plugin-babel": "4.4.0",
7777
"rollup-plugin-commonjs": "10.1.0",

packages/autocomplete-core/src/__tests__/concurrency.test.ts

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ describe('concurrency', () => {
3939

4040
await defer(noop, timeout);
4141

42-
let stateHistory: Array<
43-
AutocompleteState<Item>
44-
> = onStateChange.mock.calls.flatMap((x) => x[0].state);
42+
let stateHistory: Array<AutocompleteState<Item>> =
43+
onStateChange.mock.calls.flatMap((x) => x[0].state);
4544

4645
const itemsHistory: Item[] = stateHistory.flatMap(({ collections }) =>
4746
collections.flatMap((x) => x.items)
@@ -195,14 +194,11 @@ describe('concurrency', () => {
195194
});
196195
const getSources = jest.fn(delayedGetSources);
197196

198-
const {
199-
inputElement,
200-
getEnvironmentProps,
201-
formElement,
202-
} = createPlayground(createAutocomplete, {
203-
onStateChange,
204-
getSources,
205-
});
197+
const { inputElement, getEnvironmentProps, formElement } =
198+
createPlayground(createAutocomplete, {
199+
onStateChange,
200+
getSources,
201+
});
206202

207203
const panelElement = document.createElement('div');
208204

@@ -262,14 +258,11 @@ describe('concurrency', () => {
262258
});
263259
const getSources = jest.fn(delayedGetSources);
264260

265-
const {
266-
getEnvironmentProps,
267-
inputElement,
268-
formElement,
269-
} = createPlayground(createAutocomplete, {
270-
onStateChange,
271-
getSources,
272-
});
261+
const { getEnvironmentProps, inputElement, formElement } =
262+
createPlayground(createAutocomplete, {
263+
onStateChange,
264+
getSources,
265+
});
273266

274267
const panelElement = document.createElement('div');
275268

@@ -404,15 +397,12 @@ describe('concurrency', () => {
404397
];
405398
}, delay);
406399
});
407-
const {
408-
getEnvironmentProps,
409-
inputElement,
410-
formElement,
411-
} = createPlayground(createAutocomplete, {
412-
debug: true,
413-
onStateChange,
414-
getSources,
415-
});
400+
const { getEnvironmentProps, inputElement, formElement } =
401+
createPlayground(createAutocomplete, {
402+
debug: true,
403+
onStateChange,
404+
getSources,
405+
});
416406

417407
const panelElement = document.createElement('div');
418408

0 commit comments

Comments
 (0)