From 49c18ab9eb9f76c0189eae961dfee0550ad11e45 Mon Sep 17 00:00:00 2001 From: bc-marco <109162781+bc-marco@users.noreply.github.com> Date: Sat, 22 Apr 2023 10:01:46 -0600 Subject: [PATCH] feat: improve lint tools (#256) * chore: setup linter and formater tools fix: add formater to all known files fix: linter and formatter fixes with some ignored rules fix: linter fixes fix: change way to detect tsconfig files fix: update linter settings fix: use single qoute always and semicolon just when it's necessary * fix: add sort imports (#279) * feat: add support for import sorting plugin - added import sorting plugin - also converted from .js file to .json file so typescript compiler and eslint doesn't complain about commonjs module syntax * fix: converted all .eslintrc.js to .eslintrc.json and only use one "root" config so everything is shared * fix: sort imports lint fix * fix: import extension error to be disabled in shared elsint config --------- Co-authored-by: Micah Thomas <95306190+bc-micah@users.noreply.github.com> --- .editorconfig | 14 - .eslintrc.js | 6 - .eslintrc.json | 14 + .github/PULL_REQUEST_TEMPLATE.md | 4 + .github/workflows/main.yaml | 1 - .prettierignore | 3 + .prettierrc.json | 4 + README.md | 3 +- apps/storefront/.eslintrc.json | 17 + apps/storefront/index.html | 1212 ++++++++++------- apps/storefront/package.json | 4 + apps/storefront/src/App.tsx | 115 +- .../src/components/B3AddToQuoteTip.tsx | 13 +- apps/storefront/src/components/B3Card.tsx | 37 +- .../src/components/B3CollapseContainer.tsx | 33 +- .../src/components/B3CustomForm.tsx | 126 +- apps/storefront/src/components/B3Dialog.tsx | 153 +-- apps/storefront/src/components/B3DropDown.tsx | 47 +- .../storefront/src/components/B3GlobalTip.tsx | 47 +- .../src/components/B3LinkTipContent.tsx | 40 +- .../src/components/B3ProductList.tsx | 453 +++--- .../src/components/B3QuantityTextField.tsx | 54 +- apps/storefront/src/components/B3Socket.tsx | 11 +- .../src/components/B3StoreContainer.tsx | 69 +- apps/storefront/src/components/B3Tag.tsx | 41 +- apps/storefront/src/components/B3Tip.tsx | 31 +- .../src/components/RegisteredCloseButton.tsx | 60 +- apps/storefront/src/components/ThemeFrame.tsx | 81 +- .../src/components/button/CustomButton.tsx | 51 +- .../src/components/captcha/Captcha.tsx | 61 +- .../components/captcha/frameCaptchaCode.js | 32 +- .../src/components/extraTip/CheckoutTip.tsx | 116 +- .../src/components/filter/B3Filter.tsx | 221 ++- .../src/components/filter/B3FilterMore.tsx | 159 +-- .../src/components/filter/B3FilterPicker.tsx | 141 +- .../src/components/filter/B3FilterSearch.tsx | 23 +- .../components/filter/B3FilterToggleTable.tsx | 30 +- .../src/components/form/B3ControlCheckbox.tsx | 111 +- .../components/form/B3ControlFileUpload.tsx | 133 +- .../src/components/form/B3ControlPicker.tsx | 131 +- .../components/form/B3ControlProductRadio.tsx | 22 +- .../components/form/B3ControlRadioGroup.tsx | 106 +- .../components/form/B3ControlRectangle.tsx | 141 +- .../src/components/form/B3ControlSelect.tsx | 142 +- .../components/form/B3ControlSwatchRadio.tsx | 40 +- .../components/form/B3ControlTextField.tsx | 152 +-- apps/storefront/src/components/form/index.ts | 42 +- apps/storefront/src/components/form/styled.ts | 43 +- apps/storefront/src/components/form/ui.ts | 33 +- apps/storefront/src/components/index.ts | 125 +- .../src/components/layout/B3AccountInfo.tsx | 131 +- .../src/components/layout/B3Header.tsx | 4 +- .../src/components/layout/B3Layout.tsx | 196 +-- .../src/components/layout/B3LayoutTip.tsx | 55 +- .../src/components/layout/B3Logo.tsx | 31 +- .../src/components/layout/B3Mainheader.tsx | 78 +- .../src/components/layout/B3MobileLayout.tsx | 76 +- .../src/components/layout/B3Nav.tsx | 105 +- .../src/components/layout/B3RenderRouter.tsx | 131 +- .../src/components/layout/index.tsx | 16 +- .../src/components/layout/styled.ts | 13 +- .../loadding/B3HomePageLoadding.tsx | 12 +- .../src/components/loadding/B3PageMask.tsx | 29 +- .../src/components/loadding/Loading.tsx | 57 +- .../src/components/loadding/index.ts | 9 +- .../outSideComponents/B3HoverButton.tsx | 106 +- .../outSideComponents/B3MasquradeGobalTip.tsx | 360 ++--- .../outSideComponents/utils/b3CustomStyles.ts | 48 +- .../src/components/spin/B3Sping.tsx | 82 +- apps/storefront/src/components/spin/styled.ts | 62 +- apps/storefront/src/components/styled.ts | 14 +- .../src/components/table/B3InfiniteScroll.tsx | 54 +- .../src/components/table/B3NoData.tsx | 51 +- .../components/table/B3PaginationTable.tsx | 164 ++- .../src/components/table/B3Table.tsx | 505 ++++--- .../storefront/src/components/ui/B3Picker.tsx | 90 +- .../storefront/src/components/ui/B3Select.tsx | 56 +- apps/storefront/src/components/ui/index.ts | 9 +- .../src/components/upload/B3Upload.tsx | 326 ++--- .../components/upload/B3UploadLoadding.tsx | 49 +- .../src/components/upload/BulkUploadTable.tsx | 188 ++- .../components/upload/BulkUploadTableCard.tsx | 97 +- .../storefront/src/components/upload/utils.ts | 4 +- apps/storefront/src/constants/index.ts | 9 +- .../src/hooks/dom/useCartToQuote.ts | 66 +- .../src/hooks/dom/useDomVariation.ts | 15 +- apps/storefront/src/hooks/dom/useMyQuote.ts | 86 +- apps/storefront/src/hooks/dom/useOpenPDP.ts | 99 +- .../src/hooks/dom/useRegisteredbctob2b.ts | 61 +- apps/storefront/src/hooks/dom/utils.ts | 298 ++-- apps/storefront/src/hooks/index.ts | 65 +- .../storefront/src/hooks/useCardListColumn.ts | 17 +- apps/storefront/src/hooks/useDebounce.ts | 6 +- apps/storefront/src/hooks/useGetCountry.ts | 96 +- apps/storefront/src/hooks/useMobile.ts | 9 +- apps/storefront/src/hooks/useRole.ts | 21 +- apps/storefront/src/hooks/useScrollBar.ts | 17 +- apps/storefront/src/hooks/useSetOpen.ts | 43 +- apps/storefront/src/index.d.ts | 4 +- apps/storefront/src/load-functions.ts | 55 +- apps/storefront/src/locales/en-US/global.ts | 9 +- apps/storefront/src/locales/en-US/index.ts | 5 +- apps/storefront/src/locales/en-US/users.ts | 78 +- apps/storefront/src/locales/index.ts | 8 +- apps/storefront/src/locales/zh-CN/global.ts | 6 +- apps/storefront/src/locales/zh-CN/index.ts | 6 +- apps/storefront/src/locales/zh-CN/users.ts | 39 +- apps/storefront/src/main.css | 26 +- apps/storefront/src/main.ts | 5 +- apps/storefront/src/pages/Form.tsx | 91 +- apps/storefront/src/pages/Home.tsx | 19 +- .../pages/accountSetting/AccountSetting.tsx | 264 ++-- .../src/pages/accountSetting/config.ts | 40 +- apps/storefront/src/pages/address/Address.tsx | 153 +-- .../pages/address/components/AddressForm.tsx | 389 +++--- .../address/components/AddressItemCard.tsx | 134 +- ...essDialog .tsx => DeleteAddressDialog.tsx} | 49 +- .../address/components/SetDefaultDialog.tsx | 87 +- .../src/pages/address/shared/config.ts | 29 +- .../pages/address/shared/getAddressFields.ts | 46 +- .../src/pages/dashboard/Dashboard.tsx | 142 +- .../dashboard/components/DashboardCard.tsx | 179 ++- .../src/pages/homePage/HomePage.tsx | 6 +- .../src/pages/invoiceDetail/InvoiceDetail.tsx | 8 +- .../src/pages/login/ForgotPassword.tsx | 124 +- apps/storefront/src/pages/login/Login.tsx | 298 ++-- apps/storefront/src/pages/login/LoginForm.tsx | 77 +- .../storefront/src/pages/login/LoginPanel.tsx | 53 +- .../src/pages/login/component/LoginWidget.tsx | 46 +- apps/storefront/src/pages/login/config.ts | 80 +- apps/storefront/src/pages/login/styled.ts | 5 +- .../src/pages/order/CompanyOrder.tsx | 8 +- apps/storefront/src/pages/order/MyOrder.tsx | 6 +- apps/storefront/src/pages/order/Order.tsx | 226 ++- .../src/pages/order/OrderItemCard.tsx | 67 +- .../pages/order/components/OrderStatus.tsx | 30 +- .../src/pages/order/components/index.ts | 3 - apps/storefront/src/pages/order/config.ts | 60 +- .../src/pages/order/shared/getOrderStatus.ts | 9 +- .../src/pages/orderDetail/OrderDetail.tsx | 211 ++- .../components/CreateShoppingList.tsx | 55 +- .../components/DetailPagination.tsx | 83 +- .../orderDetail/components/OrderAction.tsx | 286 ++-- .../components/OrderCheckboxProduct.tsx | 333 ++--- .../orderDetail/components/OrderDialog.tsx | 233 ++-- .../orderDetail/components/OrderHistory.tsx | 146 +- .../orderDetail/components/OrderProduct.tsx | 164 +-- .../orderDetail/components/OrderShipping.tsx | 262 ++-- .../components/OrderShoppingList.tsx | 147 +- .../src/pages/orderDetail/components/index.ts | 19 +- .../context/OrderDetailsContext.tsx | 77 +- .../pages/orderDetail/shared/B2BOrderData.ts | 69 +- .../pages/orderDetail/shared/BCOrderData.ts | 5 - .../src/pages/orderDetail/shared/config.ts | 30 +- apps/storefront/src/pages/pdp/PDP.tsx | 135 +- .../src/pages/quickorder/Quickorder.tsx | 44 +- .../pages/quickorder/components/QuickAdd.tsx | 216 ++- .../quickorder/components/QuickOrderCard.tsx | 95 +- .../components/QuickOrderFooter.tsx | 466 +++---- .../quickorder/components/QuickOrderPad.tsx | 189 ++- .../quickorder/components/QuickorderTable.tsx | 271 ++-- .../src/pages/quote/QuoteDetail.tsx | 251 ++-- .../storefront/src/pages/quote/QuoteDraft.tsx | 473 +++---- .../storefront/src/pages/quote/QuotesList.tsx | 271 ++-- .../src/pages/quote/components/AddToQuote.tsx | 259 ++-- .../quote/components/AddressItemCard.tsx | 86 +- .../pages/quote/components/ChooseAddress.tsx | 76 +- .../pages/quote/components/ContactInfo.tsx | 87 +- .../src/pages/quote/components/FileUpload.tsx | 200 ++- .../src/pages/quote/components/Message.tsx | 434 +++--- .../pages/quote/components/QuoteAddress.tsx | 135 +- .../quote/components/QuoteAttachment.tsx | 99 +- .../quote/components/QuoteDetailFooter.tsx | 125 +- .../quote/components/QuoteDetailHeader.tsx | 225 ++- .../quote/components/QuoteDetailSummary.tsx | 62 +- .../quote/components/QuoteDetailTable.tsx | 198 ++- .../quote/components/QuoteDetailTableCard.tsx | 138 +- .../src/pages/quote/components/QuoteInfo.tsx | 197 ++- .../pages/quote/components/QuoteItemCard.tsx | 108 +- .../src/pages/quote/components/QuoteNote.tsx | 133 +- .../pages/quote/components/QuoteStatus.tsx | 27 +- .../pages/quote/components/QuoteSummary.tsx | 293 ++-- .../src/pages/quote/components/QuoteTable.tsx | 371 +++-- .../pages/quote/components/QuoteTableCard.tsx | 150 +- .../components/QuoteTermsAndConditions.tsx | 33 +- apps/storefront/src/pages/quote/config.ts | 4 +- .../src/pages/quote/shared/config.ts | 154 +-- apps/storefront/src/pages/quote/style.ts | 59 +- .../src/pages/registered/RegisterComplete.tsx | 244 ++-- .../src/pages/registered/RegisterContent.tsx | 31 +- .../src/pages/registered/Registered.tsx | 228 ++-- .../pages/registered/RegisteredAccount.tsx | 225 ++- .../pages/registered/RegisteredBCToB2B.tsx | 430 +++--- .../src/pages/registered/RegisteredDetail.tsx | 196 ++- .../src/pages/registered/RegisteredFinish.tsx | 87 +- .../src/pages/registered/RegisteredStep.tsx | 73 +- .../component/RegisteredSigleCheckBox.tsx | 23 +- .../component/RegisteredStepButton.tsx | 67 +- .../storefront/src/pages/registered/config.ts | 169 +-- .../registered/context/RegisteredContext.tsx | 78 +- apps/storefront/src/pages/seleRep/SeleRep.tsx | 43 +- .../ShoppingListDetails.tsx | 311 ++--- .../components/AddToShoppingList.tsx | 114 +- .../components/ChooseOptionsDialog.tsx | 224 ++- .../components/ProductListDialog.tsx | 226 ++- .../components/QuickAdd.tsx | 178 ++- .../components/ReAddToCart.tsx | 534 ++++---- .../components/SearchProduct.tsx | 79 +- .../components/ShoppingDetailCard.tsx | 155 +-- .../components/ShoppingDetailDeleteItems.tsx | 27 +- .../components/ShoppingDetailFooter.tsx | 296 ++-- .../components/ShoppingDetailHeader.tsx | 164 +-- .../components/ShoppingDetailTable.tsx | 333 +++-- .../context/ShoppingListDetailsContext.tsx | 51 +- .../shoppingLists/AddEditShoppingLists.tsx | 55 +- .../src/pages/shoppingLists/ShoppingLists.tsx | 117 +- .../pages/shoppingLists/ShoppingListsCard.tsx | 128 +- .../pages/shoppingLists/ShoppingStatus.tsx | 42 +- .../src/pages/shoppingLists/config.ts | 38 +- .../src/pages/usermanagement/AddEditUser.tsx | 69 +- .../src/pages/usermanagement/UserItemCard.tsx | 68 +- .../pages/usermanagement/Usermanagement.tsx | 84 +- .../src/pages/usermanagement/config.ts | 30 +- apps/storefront/src/react-setup.tsx | 47 +- .../customStyleButtton/context/Provider.tsx | 38 +- .../customStyleButtton/context/config.ts | 77 +- .../customStyleButtton/context/index.ts | 19 +- .../src/shared/customStyleButtton/index.ts | 14 +- .../dynamicallyVariable/context/Provider.tsx | 38 +- .../dynamicallyVariable/context/config.ts | 48 +- .../dynamicallyVariable/context/index.ts | 30 +- .../src/shared/dynamicallyVariable/index.ts | 14 +- .../src/shared/global/context/Provider.tsx | 36 +- .../src/shared/global/context/config.ts | 172 +-- .../src/shared/global/context/index.ts | 11 +- apps/storefront/src/shared/global/index.ts | 14 +- apps/storefront/src/shared/routes/index.ts | 11 +- apps/storefront/src/shared/routes/routes.ts | 99 +- .../src/shared/service/b2b/api/address.ts | 22 +- .../src/shared/service/b2b/api/global.ts | 35 +- .../src/shared/service/b2b/api/login.ts | 13 +- .../src/shared/service/b2b/api/order.ts | 13 +- .../src/shared/service/b2b/api/register.ts | 26 +- .../service/b2b/graphql/accountSetting.ts | 43 +- .../src/shared/service/b2b/graphql/address.ts | 98 +- .../src/shared/service/b2b/graphql/global.ts | 129 +- .../src/shared/service/b2b/graphql/orders.ts | 53 +- .../src/shared/service/b2b/graphql/product.ts | 85 +- .../shared/service/b2b/graphql/quickorder.ts | 20 +- .../src/shared/service/b2b/graphql/quote.ts | 170 ++- .../shared/service/b2b/graphql/register.ts | 113 +- .../service/b2b/graphql/shoppingList.ts | 251 ++-- .../src/shared/service/b2b/graphql/users.ts | 44 +- .../src/shared/service/b2b/index.ts | 347 +++-- .../src/shared/service/bc/api/cart.ts | 40 +- .../src/shared/service/bc/api/login.ts | 22 +- .../src/shared/service/bc/api/product.ts | 24 +- .../src/shared/service/bc/api/register.ts | 17 +- .../src/shared/service/bc/graphql/login.ts | 20 +- .../src/shared/service/bc/graphql/user.ts | 13 +- .../storefront/src/shared/service/bc/index.ts | 50 +- .../src/shared/service/request/b3Fetch.ts | 114 +- .../src/shared/service/request/base.ts | 8 +- .../src/shared/service/request/fetch.ts | 112 +- apps/storefront/src/store/index.ts | 2 +- apps/storefront/src/store/reducer.ts | 7 +- apps/storefront/src/store/selectors.ts | 17 +- apps/storefront/src/store/slices/glabol.ts | 43 +- apps/storefront/src/store/slices/theme.ts | 22 +- apps/storefront/src/theme.tsx | 66 +- apps/storefront/src/types/address.ts | 4 +- apps/storefront/src/types/global.ts | 4 +- apps/storefront/src/types/index.ts | 4 +- apps/storefront/src/types/order.ts | 10 +- apps/storefront/src/types/orderDetail.ts | 352 +++-- apps/storefront/src/types/products.ts | 260 ++-- apps/storefront/src/types/shoppingList.ts | 162 ++- .../src/utils/b3AddToShoppingList.ts | 118 +- .../src/utils/b3DateFormat/index.ts | 51 +- apps/storefront/src/utils/b3Init.ts | 29 +- apps/storefront/src/utils/b3PageMask.ts | 5 +- apps/storefront/src/utils/b3Picker.ts | 11 +- apps/storefront/src/utils/b3Price.ts | 16 +- apps/storefront/src/utils/b3PrintInvoice.tsx | 3 +- apps/storefront/src/utils/b3Product.ts | 216 +++ .../src/utils/b3Product/b3Product.ts | 302 ++-- .../src/utils/b3Product/b3TaxRate.ts | 21 +- .../src/utils/b3Product/shared/config.ts | 397 +++--- apps/storefront/src/utils/b3Proxy.ts | 8 +- .../src/utils/b3RolePermissions/index.ts | 9 +- .../juniorRolePermissions.ts | 8 +- apps/storefront/src/utils/b3Storage.ts | 15 +- apps/storefront/src/utils/b3Tip.ts | 27 +- apps/storefront/src/utils/b3utils.ts | 6 +- apps/storefront/src/utils/basicConfig.ts | 6 +- apps/storefront/src/utils/currencyUtils.ts | 52 +- apps/storefront/src/utils/index.ts | 135 +- apps/storefront/src/utils/loginInfo.ts | 92 +- apps/storefront/src/utils/storefrontConfig.ts | 78 +- apps/storefront/src/utils/validatorRules.ts | 60 +- .../tests/components/ThemeFrame.test.tsx | 19 +- .../tests/components/captcha/Captcha.test.tsx | 48 +- apps/storefront/tests/test-utils.tsx | 56 +- apps/storefront/tsconfig.json | 3 +- apps/storefront/vite.config.ts | 14 +- package.json | 13 +- packages/eslint-config-b2b/.eslintrc.json | 87 ++ packages/eslint-config-b2b/package.json | 24 + packages/eslint-config-b3/index.js | 74 - packages/eslint-config-b3/package.json | 20 - packages/global-b3/.eslintrc.json | 7 + packages/global-b3/index.ts | 4 +- packages/global-b3/package.json | 11 +- packages/global-b3/tsconfig.json | 4 + packages/hooks/.eslintrc.json | 8 + packages/hooks/index.d.ts | 5 + packages/hooks/index.ts | 18 +- packages/hooks/package.json | 11 + packages/hooks/tsconfig.json | 6 + packages/hooks/useB3AppOpen.ts | 38 +- packages/hooks/useMutationObservable.ts | 22 +- packages/hooks/useWindowSize.ts | 6 +- packages/lang/.eslintrc.json | 3 + packages/lang/LangProvider.tsx | 33 +- packages/lang/index.ts | 4 +- packages/lang/locales/en-US/index.ts | 3 +- packages/lang/locales/index.ts | 5 +- packages/lang/package.json | 11 +- packages/lang/tsconfig.json | 8 +- packages/lang/useB3Lang.ts | 21 +- packages/store/.eslintrc.json | 9 + packages/store/package.json | 7 + packages/store/reducer.ts | 45 +- packages/store/slices/lang.ts | 20 +- packages/store/tsconfig.json | 4 + packages/tsconfig/vite.json | 1 + packages/ui/.gitignore | 24 - packages/ui/package.json | 31 - packages/ui/src/index.tsx | 1 - packages/ui/tsconfig.json | 8 - packages/utils/.eslintrc.json | 6 + packages/utils/Lang/index.ts | 4 +- packages/utils/index.ts | 5 +- packages/utils/package.json | 7 + packages/utils/tsconfig.json | 4 + rfc/migrate-contexts-to-redux.md | 43 +- turbo.json | 4 +- yarn.lock | 890 +++++++++--- 348 files changed, 14652 insertions(+), 17449 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 apps/storefront/.eslintrc.json rename apps/storefront/src/pages/address/components/{DeleteAddressDialog .tsx => DeleteAddressDialog.tsx} (70%) delete mode 100644 apps/storefront/src/pages/order/components/index.ts delete mode 100644 apps/storefront/src/pages/orderDetail/shared/BCOrderData.ts create mode 100644 apps/storefront/src/utils/b3Product.ts create mode 100644 packages/eslint-config-b2b/.eslintrc.json create mode 100644 packages/eslint-config-b2b/package.json delete mode 100644 packages/eslint-config-b3/index.js delete mode 100644 packages/eslint-config-b3/package.json create mode 100644 packages/global-b3/.eslintrc.json create mode 100644 packages/global-b3/tsconfig.json create mode 100644 packages/hooks/.eslintrc.json create mode 100644 packages/hooks/index.d.ts create mode 100644 packages/hooks/tsconfig.json create mode 100644 packages/lang/.eslintrc.json create mode 100644 packages/store/.eslintrc.json create mode 100644 packages/store/tsconfig.json delete mode 100644 packages/ui/.gitignore delete mode 100644 packages/ui/package.json delete mode 100644 packages/ui/src/index.tsx delete mode 100644 packages/ui/tsconfig.json create mode 100644 packages/utils/.eslintrc.json create mode 100644 packages/utils/tsconfig.json diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 65a5ef41..00000000 --- a/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -end_of_line = lf -# editorconfig-tools is unable to ignore longs strings or urls -max_line_length = off - -[CHANGELOG.md] -indent_size = false \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index bea12e86..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - env: { - browser: true, - }, - extends: ['b3'], -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..8e999412 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "root": true, + "extends": ["b2b"], + "settings": { + "import/resolver": { + "typescript": { + "project": ["packages/*/tsconfig.json", "apps/*/tsconfig.json"] + } + } + }, + "parserOptions": { + "project": ["packages/*/tsconfig.json", "apps/*/tsconfig.json"] + } +} diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6b331dd3..dcfcbb81 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,22 @@ ## What? + Write a description of the changes you're making here, and decisions that you made along the way. Provide enough context that the reviewer(s) can understand your changes, and the intent behind them. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#what) ## Why? + Describe the underlying driver or intent behind this change. Provide some context on why it's needed or what is the intended use. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#why) ## Testing / Proof + Explain what you did to test and ensure that these changes work the way you expect. You must provide evidence in the form of unit tests, screenshots, logs, API payloads or other output to show the expected behaviour. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#testing--proof) ## How can this change be undone in case of failure? + Provide experiments, feature flags or other mechanisms which used to reduce the risk of changes introduced in this PR. For more details refer to [contributing guideline](https://github.com/bigcommerce/bigcommerce/blob/master/CONTRIBUTING.md#how-can-this-change-be-undone-in-case-of-failure) ping {suggested reviewers} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d44e8136..c604f520 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -9,7 +9,6 @@ on: - dev - main - jobs: test: runs-on: ubuntu-latest diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..35c9504c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +**/dist +**/out +**/build \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..b2095be8 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/README.md b/README.md index 785ab22c..98ed9d98 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package ## Apps and Packages -- `/apps/storefront`: the new BundleB2B storefront aplication, [React 18](https://reactjs.org/) app using [vite](http://vitejs.dev/) as the building tool. +- `/apps/storefront`: the new BundleB2B storefront aplication, [React 18](https://reactjs.org/) app using [vite](http://vitejs.dev/) as the building tool. - `/packages/eslint-config-b3`: the shared eslint config. @@ -26,6 +26,7 @@ This turborepo has the tools and packages already setup: - [React Router 6](https://reactrouter.com/) as the frontend router. ## Setup + 1. Run `yarn install` 2. Copy `apps/storefront/.env-example` and paste it as `.env` 3. Update the `VITE_STORE_HASH` value on `.env` file diff --git a/apps/storefront/.eslintrc.json b/apps/storefront/.eslintrc.json new file mode 100644 index 00000000..b92cc5f7 --- /dev/null +++ b/apps/storefront/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "extends": ["b2b"], + "rules": { + // TODO: make a soft update removing one by one + "import/no-cycle": 0, + "react-hooks/exhaustive-deps": 0, + "react/jsx-props-no-spreading": 0, + "@typescript-eslint/no-shadow": 0, + "no-param-reassign": 0, + "@typescript-eslint/no-explicit-any": 0, + "no-console": 0, + "@typescript-eslint/ban-types": 0, + "@typescript-eslint/no-namespace": 0, + "react/destructuring-assignment": 0, + "@typescript-eslint/no-non-null-assertion": 0 + } +} diff --git a/apps/storefront/index.html b/apps/storefront/index.html index d710a364..6b88c701 100644 --- a/apps/storefront/index.html +++ b/apps/storefront/index.html @@ -6,23 +6,26 @@