From c8a0f68e505c72a5088d1adca8e7ca0775f2a448 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Fri, 28 Oct 2022 14:38:54 +0200 Subject: [PATCH] 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: https://github.com/microsoft/TypeScript/issues/37144 --- .../src/types/algoliasearch.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/autocomplete-preset-algolia/src/types/algoliasearch.ts b/packages/autocomplete-preset-algolia/src/types/algoliasearch.ts index 39d6821a7..201377a12 100644 --- a/packages/autocomplete-preset-algolia/src/types/algoliasearch.ts +++ b/packages/autocomplete-preset-algolia/src/types/algoliasearch.ts @@ -11,11 +11,11 @@ type SearchClientShape = { }; type ClientLiteV5 = AnyToUnknown< - // @ts-ignore + /** @ts-ignore */ ReturnType >; type ClientSearchV5 = AnyToUnknown< - // @ts-ignore + /** @ts-ignore */ ReturnType >; type ClientV5 = ClientLiteV5 extends SearchClientShape @@ -29,43 +29,43 @@ type PickForClient< > = ClientV5 extends SearchClientShape ? TMapping['v5'] : TMapping['v4']; export type SearchClient = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: AlgoliaSearch.SearchClient; - // @ts-ignore + /** @ts-ignore */ v5: ClientV5; }>; export type MultipleQueriesQuery = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: ClientSearch.MultipleQueriesQuery; - // @ts-ignore + /** @ts-ignore */ v5: AlgoliaSearch.LegacySearchMethodProps[number]; }>; export type SearchForFacetValuesResponse = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: ClientSearch.SearchForFacetValuesResponse; - // @ts-ignore + /** @ts-ignore */ v5: AlgoliaSearch.SearchForFacetValuesResponse; }>; export type SearchResponse = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: ClientSearch.SearchResponse; - // @ts-ignore + /** @ts-ignore */ v5: AlgoliaSearch.SearchResponse; }>; export type HighlightResult = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: ClientSearch.HighlightResult; - // @ts-ignore + /** @ts-ignore */ v5: AlgoliaSearch.HighlightResult; // should be generic, but isn't yet in the client }>; export type SnippetResult = PickForClient<{ - // @ts-ignore + /** @ts-ignore */ v4: ClientSearch.SnippetResult; - // @ts-ignore + /** @ts-ignore */ v5: AlgoliaSearch.SnippetResult; // should be generic, but isn't yet in the client }>;