-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove ts-strict-ignore and fix TypeScript errors [searches] #6113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchAttributesDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,3 @@ | ||||||
| // @ts-strict-ignore | ||||||
| import { gql, useApolloClient } from "@apollo/client"; | ||||||
| import { | ||||||
| SearchAttributeValuesDocument, | ||||||
|
|
@@ -39,18 +38,19 @@ export function useSearchAttributeValuesSuggestions() { | |||||
| query, | ||||||
| }, | ||||||
| }) | ||||||
| .then(({ data }) => | ||||||
| mapEdgesToItems(data.attribute.choices).map(({ name, slug }) => ({ | ||||||
| label: name, | ||||||
| value: slug, | ||||||
| })), | ||||||
| .then( | ||||||
| ({ data }) => | ||||||
| mapEdgesToItems(data.attribute?.choices ?? undefined)?.map(({ name, slug }) => ({ | ||||||
|
||||||
| mapEdgesToItems(data.attribute?.choices ?? undefined)?.map(({ name, slug }) => ({ | |
| mapEdgesToItems(data.attribute?.choices)?.map(({ name, slug }) => ({ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchCategoriesDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchCollectionsDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchCustomersDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchGiftCardTagsDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchOrderVariantDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchPagesDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchPageTypesDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchPermissionGroupsDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchProductsDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,3 @@ | ||||||
| // @ts-strict-ignore | ||||||
| import { gql, useApolloClient } from "@apollo/client"; | ||||||
| import { | ||||||
| SearchProductTypesDocument, | ||||||
|
|
@@ -36,11 +35,12 @@ export function useSearchProductTypes() { | |||||
| query, | ||||||
| }, | ||||||
| }) | ||||||
| .then(({ data }) => | ||||||
| mapEdgesToItems(data.search).map(({ name, id }) => ({ | ||||||
| label: name, | ||||||
| value: id, | ||||||
| })), | ||||||
| .then( | ||||||
| ({ data }) => | ||||||
| mapEdgesToItems(data.search ?? undefined)?.map(({ name, id }) => ({ | ||||||
|
||||||
| mapEdgesToItems(data.search ?? undefined)?.map(({ name, id }) => ({ | |
| mapEdgesToItems(data.search)?.map(({ name, id }) => ({ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchShippingZonesDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchStaffMembersDocument, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // @ts-strict-ignore | ||
| import { gql } from "@apollo/client"; | ||
| import { | ||
| SearchWarehousesDocument, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug:
prev.searchcould benullhere, which would cause issues when spreading it on line 37. The null check on line 30 only validates thatnext.searchexists, but doesn't checkprev.search. Consider adding a check likeif (!next.search || !prev.search)on line 30 to ensure both are non-null before attempting to merge them.