From 76f5da73a9688e2fbba42e754f57657e877354d3 Mon Sep 17 00:00:00 2001 From: Emerson Laurentino Date: Fri, 17 Jun 2022 12:24:34 -0300 Subject: [PATCH] fix: docs eslint errors --- .../components/DocStructure/DocStructure.js | 4 +- .../src/components/DocUpdate/DocUpdate.js | 10 +-- apps/docs/src/components/hooks/useInterval.ts | 3 +- .../src/components/hooks/useWindowSize.ts | 7 +- .../src/pages/sections/FaqPage/FaqPage.js | 2 +- .../StarterComponentPage.js | 2 +- apps/docs/src/pages/starters/submissions.js | 2 +- packages/api/src/__generated__/schema.ts | 82 +++++++++++-------- 8 files changed, 64 insertions(+), 48 deletions(-) diff --git a/apps/docs/src/components/DocStructure/DocStructure.js b/apps/docs/src/components/DocStructure/DocStructure.js index 4cca9b4dd7..4ac3a6d307 100644 --- a/apps/docs/src/components/DocStructure/DocStructure.js +++ b/apps/docs/src/components/DocStructure/DocStructure.js @@ -1,6 +1,6 @@ import React from 'react' import Link from '@docusaurus/Link' -import useBaseUrl from '@docusaurus/useBaseUrl' +import baseUrl from '@docusaurus/useBaseUrl' let docs = [ { @@ -39,7 +39,7 @@ const DocStructure = () => { {docs.map((item, i) => (

{item.title}

{item.description}

diff --git a/apps/docs/src/components/DocUpdate/DocUpdate.js b/apps/docs/src/components/DocUpdate/DocUpdate.js index 34fc25833e..4ab0a2f0a7 100644 --- a/apps/docs/src/components/DocUpdate/DocUpdate.js +++ b/apps/docs/src/components/DocUpdate/DocUpdate.js @@ -56,8 +56,8 @@ const DocUpdate = () => {
{item.type === 'Fixed' && ( - - + + )} {item.type === 'Removed' && ( @@ -68,8 +68,8 @@ const DocUpdate = () => { )} {item.type === 'Improved' && ( - - + + )} {item.type === 'Added' && ( @@ -100,7 +100,7 @@ const DocUpdate = () => { comp = (

Documentation Updates

-

There weren't any documentation updates in the last month.

+

There {"weren't"} any documentation updates in the last month.

) } diff --git a/apps/docs/src/components/hooks/useInterval.ts b/apps/docs/src/components/hooks/useInterval.ts index b5f159a779..f699a40eee 100644 --- a/apps/docs/src/components/hooks/useInterval.ts +++ b/apps/docs/src/components/hooks/useInterval.ts @@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react'; export function useInterval(callback, delay) { - const savedCallback = useRef(); + const savedCallback = useRef(); // Remember the latest function. useEffect(() => { @@ -12,7 +12,6 @@ export function useInterval(callback, delay) { // Set up the interval. useEffect(() => { - // @ts-ignore const tick = () => savedCallback.current(); if (delay !== null) { diff --git a/apps/docs/src/components/hooks/useWindowSize.ts b/apps/docs/src/components/hooks/useWindowSize.ts index 4cbd65eb59..d28f594471 100644 --- a/apps/docs/src/components/hooks/useWindowSize.ts +++ b/apps/docs/src/components/hooks/useWindowSize.ts @@ -11,9 +11,9 @@ export function useWindowSize(): WindowSizeInterface { // Initialize state with undefined width/height so server and client renders match // Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/ const [windowSize, setWindowSize] = useState({ - windowWidth: undefined, - windowHeight: undefined, - scrollHeight: undefined, + windowWidth: 0, + windowHeight: 0, + scrollHeight: 0, }); // Return if running on server @@ -21,6 +21,7 @@ export function useWindowSize(): WindowSizeInterface { return { windowWidth: 0, windowHeight: 0, scrollHeight: 0 }; } + // eslint-disable-next-line react-hooks/rules-of-hooks useEffect(() => { function handleResize() { setWindowSize({ diff --git a/apps/docs/src/pages/sections/FaqPage/FaqPage.js b/apps/docs/src/pages/sections/FaqPage/FaqPage.js index 490ff23276..fcf01b4825 100644 --- a/apps/docs/src/pages/sections/FaqPage/FaqPage.js +++ b/apps/docs/src/pages/sections/FaqPage/FaqPage.js @@ -43,7 +43,7 @@ const FaqPage = () => { return (
{data.map(({ question, answer }) => ( - + ))}
) diff --git a/apps/docs/src/pages/sections/StarterComponentPage/StarterComponentPage.js b/apps/docs/src/pages/sections/StarterComponentPage/StarterComponentPage.js index 63953dcdea..6f84043909 100644 --- a/apps/docs/src/pages/sections/StarterComponentPage/StarterComponentPage.js +++ b/apps/docs/src/pages/sections/StarterComponentPage/StarterComponentPage.js @@ -29,7 +29,7 @@ const StarterComponentPage = ({ data = {} }) => {

    {data.features?.map((feature) => ( -
  • {feature}
  • +
  • {feature}
  • ))}
diff --git a/apps/docs/src/pages/starters/submissions.js b/apps/docs/src/pages/starters/submissions.js index 215ea341b4..b4446d18e5 100644 --- a/apps/docs/src/pages/starters/submissions.js +++ b/apps/docs/src/pages/starters/submissions.js @@ -12,7 +12,7 @@ function Submissions() {
← Back

Starter Community

Submit your starter

-

Submit your starter and get featured on the FastStore Community Starters Library! If your starter meets our basic standards, we'll add it as quickly as possible to the Library.

+

Submit your starter and get featured on the FastStore Community Starters Library! If your starter meets our basic standards, {"we'll"} add it as quickly as possible to the Library.

diff --git a/packages/api/src/__generated__/schema.ts b/packages/api/src/__generated__/schema.ts index f188f40f0f..c154532ab0 100644 --- a/packages/api/src/__generated__/schema.ts +++ b/packages/api/src/__generated__/schema.ts @@ -19,9 +19,9 @@ export type IStoreCart = { }; export type IStoreCurrency = { - /** Currency code, e.g: USD */ + /** Currency code (e.g: USD). */ code: Scalars['String']; - /** Currency symbol, e.g: $ */ + /** Currency symbol (e.g: $). */ symbol: Scalars['String']; }; @@ -47,7 +47,7 @@ export type IStoreOffer = { seller: IStoreOrganization; }; -/** Offer input. */ +/** Order input. */ export type IStoreOrder = { /** Array with information on each accepted offer. */ acceptedOffer: Array; @@ -96,9 +96,11 @@ export type IStorePropertyValue = { valueReference: Scalars['String']; }; -/** Selected facet input. */ +/** Selected search facet input. */ export type IStoreSelectedFacet = { + /** Selected search facet key. */ key: Scalars['String']; + /** Selected search facet value. */ value: Scalars['String']; }; @@ -120,9 +122,9 @@ export type IStoreSession = { export type Mutation = { __typename?: 'Mutation'; - /** Returns the order if anything has changed in it, or `null` if the order is valid. */ + /** Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`. */ validateCart?: Maybe; - /** Validate session information. */ + /** Updates a web session with the specified values. */ validateSession?: Maybe; }; @@ -139,15 +141,15 @@ export type MutationValidateSessionArgs = { export type Query = { __typename?: 'Query'; - /** All collections query. */ + /** Returns information about all collections. */ allCollections: StoreCollectionConnection; - /** All products query. */ + /** Returns information about all products. */ allProducts: StoreProductConnection; - /** Collection query. */ + /** Returns the details of a collection based on the collection slug. */ collection: StoreCollection; - /** Product query. */ + /** Returns the details of a product based on the specified locator. */ product: StoreProduct; - /** Search query. */ + /** Returns the result of a product, facet, or suggestion search. */ search: StoreSearchResult; }; @@ -241,7 +243,7 @@ export type StoreCart = { /** Shopping cart message. */ export type StoreCartMessage = { __typename?: 'StoreCartMessage'; - /** Shopping cart message status, which can be `INFO`, `WARNING` OR `ERROR`. */ + /** Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`. */ status: StoreStatus; /** Shopping cart message text. */ text: Scalars['String']; @@ -264,21 +266,21 @@ export type StoreCollection = { type: StoreCollectionType; }; -/** Collection connection pagination information. */ +/** Collection connections, including pagination information and collections returned by the query. */ export type StoreCollectionConnection = { __typename?: 'StoreCollectionConnection'; - /** Array with collection connection page edges. */ + /** Array with collection connection page edges, each containing a collection and a corresponding cursor.. */ edges: Array; - /** Collection connection page information. */ + /** Collection pagination information. */ pageInfo: StorePageInfo; }; -/** Collection pagination edge. */ +/** Each collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination. */ export type StoreCollectionEdge = { __typename?: 'StoreCollectionEdge'; - /** Collection pagination cursor. */ + /** Collection cursor. Used as pagination reference. */ cursor: Scalars['String']; - /** Collection pagination node. */ + /** Each collection node contains the information of a product collection returned by the query. */ node: StoreCollection; }; @@ -300,18 +302,22 @@ export type StoreCollectionMeta = { /** Product collection type. Possible values are `Department`, `Category`, `Brand` or `Cluster`. */ export const enum StoreCollectionType { + /** Product brand. */ Brand = 'Brand', + /** Second level of product categorization. */ Category = 'Category', + /** Product cluster. */ Cluster = 'Cluster', + /** First level of product categorization. */ Department = 'Department' }; /** Currency information. */ export type StoreCurrency = { __typename?: 'StoreCurrency'; - /** Currency code, e.g: USD */ + /** Currency code (e.g: USD). */ code: Scalars['String']; - /** Currency symbol, e.g: $ */ + /** Currency symbol (e.g: $). */ symbol: Scalars['String']; }; @@ -330,7 +336,9 @@ export type StoreFacet = { /** Search facet type. */ export const enum StoreFacetType { + /** Indicates boolean search facet. */ Boolean = 'BOOLEAN', + /** Indicates range type search facet. */ Range = 'RANGE' }; @@ -408,16 +416,16 @@ export type StoreOrganization = { identifier: Scalars['String']; }; -/** Page information. */ +/** Whenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries. */ export type StorePageInfo = { __typename?: 'StorePageInfo'; - /** Page cursor end. */ + /** Cursor corresponding to the last possible item. */ endCursor: Scalars['String']; - /** Indicates whether next page exists. */ + /** Indicates whether there is at least one more page with items after the ones returned in the current query. */ hasNextPage: Scalars['Boolean']; - /** Indicates whether previous page exists. */ + /** Indicates whether there is at least one more page with items before the ones returned in the current query. */ hasPreviousPage: Scalars['Boolean']; - /** Page cursor start. */ + /** Cursor corresponding to the first possible item. */ startCursor: Scalars['String']; /** Total number of items (products or collections), not pages. */ totalCount: Scalars['Int']; @@ -471,21 +479,21 @@ export type StoreProduct = { slug: Scalars['String']; }; -/** Product connection pagination information. */ +/** Product connections, including pagination information and products returned by the query. */ export type StoreProductConnection = { __typename?: 'StoreProductConnection'; - /** Array with product connection page edges. */ + /** Array with product connection edges, each containing a product and a corresponding cursor. */ edges: Array; - /** Product connection page information. */ + /** Product pagination information. */ pageInfo: StorePageInfo; }; -/** Product pagination edge. */ +/** Each product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination. */ export type StoreProductEdge = { __typename?: 'StoreProductEdge'; - /** Product pagination cursor. */ + /** Product cursor. Used as pagination reference. */ cursor: Scalars['String']; - /** Product pagination node. */ + /** Each product node contains the information of a product returned by the query. */ node: StoreProduct; }; @@ -574,19 +582,27 @@ export type StoreSession = { postalCode?: Maybe; }; -/** Product sorting options used in search. */ +/** Product search results sorting options. */ export const enum StoreSort { + /** Sort by discount value, from highest to lowest. */ DiscountDesc = 'discount_desc', + /** Sort by name, in alphabetical order. */ NameAsc = 'name_asc', + /** Sort by name, in reverse alphabetical order. */ NameDesc = 'name_desc', + /** Sort by orders, from highest to lowest. */ OrdersDesc = 'orders_desc', + /** Sort by price, from lowest to highest. */ PriceAsc = 'price_asc', + /** Sort by price, from highest to lowest. */ PriceDesc = 'price_desc', + /** Sort by release date, from highest to lowest. */ ReleaseDesc = 'release_desc', + /** Sort by product score, from highest to lowest. */ ScoreDesc = 'score_desc' }; -/** Status used to indicate type of message. For instance, in shopping cart messages. */ +/** Status used to indicate a message type. For instance, a shopping cart informative or error message. */ export const enum StoreStatus { Error = 'ERROR', Info = 'INFO',