Skip to content

Commit c8a0f68

Browse files
authored
fix(preset-algolia): ensure "ts-ignore" is present in the output (#1035)
There's no real way to enforce this, but /** comments get preserved in the output, but // comments don't. This is typescript behaviour that's not well documented: microsoft/TypeScript#37144
1 parent 6cd9fd7 commit c8a0f68

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/autocomplete-preset-algolia/src/types/algoliasearch.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ type SearchClientShape = {
1111
};
1212

1313
type ClientLiteV5 = AnyToUnknown<
14-
// @ts-ignore
14+
/** @ts-ignore */
1515
ReturnType<typeof AlgoliaSearch.liteClient>
1616
>;
1717
type ClientSearchV5 = AnyToUnknown<
18-
// @ts-ignore
18+
/** @ts-ignore */
1919
ReturnType<typeof ClientSearch.searchClient>
2020
>;
2121
type ClientV5 = ClientLiteV5 extends SearchClientShape
@@ -29,43 +29,43 @@ type PickForClient<
2929
> = ClientV5 extends SearchClientShape ? TMapping['v5'] : TMapping['v4'];
3030

3131
export type SearchClient = PickForClient<{
32-
// @ts-ignore
32+
/** @ts-ignore */
3333
v4: AlgoliaSearch.SearchClient;
34-
// @ts-ignore
34+
/** @ts-ignore */
3535
v5: ClientV5;
3636
}>;
3737

3838
export type MultipleQueriesQuery = PickForClient<{
39-
// @ts-ignore
39+
/** @ts-ignore */
4040
v4: ClientSearch.MultipleQueriesQuery;
41-
// @ts-ignore
41+
/** @ts-ignore */
4242
v5: AlgoliaSearch.LegacySearchMethodProps[number];
4343
}>;
4444

4545
export type SearchForFacetValuesResponse = PickForClient<{
46-
// @ts-ignore
46+
/** @ts-ignore */
4747
v4: ClientSearch.SearchForFacetValuesResponse;
48-
// @ts-ignore
48+
/** @ts-ignore */
4949
v5: AlgoliaSearch.SearchForFacetValuesResponse;
5050
}>;
5151

5252
export type SearchResponse<THit> = PickForClient<{
53-
// @ts-ignore
53+
/** @ts-ignore */
5454
v4: ClientSearch.SearchResponse<THit>;
55-
// @ts-ignore
55+
/** @ts-ignore */
5656
v5: AlgoliaSearch.SearchResponse<THit>;
5757
}>;
5858

5959
export type HighlightResult<THit> = PickForClient<{
60-
// @ts-ignore
60+
/** @ts-ignore */
6161
v4: ClientSearch.HighlightResult<THit>;
62-
// @ts-ignore
62+
/** @ts-ignore */
6363
v5: AlgoliaSearch.HighlightResult; // should be generic, but isn't yet in the client
6464
}>;
6565

6666
export type SnippetResult<THit> = PickForClient<{
67-
// @ts-ignore
67+
/** @ts-ignore */
6868
v4: ClientSearch.SnippetResult<THit>;
69-
// @ts-ignore
69+
/** @ts-ignore */
7070
v5: AlgoliaSearch.SnippetResult; // should be generic, but isn't yet in the client
7171
}>;

0 commit comments

Comments
 (0)