From b2364360ff814d2bb903ddc0681103c791df07fe Mon Sep 17 00:00:00 2001 From: kabin thakuri Date: Tue, 28 Apr 2026 17:31:10 +0545 Subject: [PATCH 1/3] refactor(eslint-config): update components based on perfectionist plugin rules --- apps/demo/package.json | 2 +- apps/demo/setup-test.ts | 2 +- apps/demo/src/Routers.tsx | 38 +- .../__test__/ErrorBoundary.snapshot.test.tsx | 2 +- .../__test__/ErrorBoundary.test.tsx | 2 +- apps/demo/src/Views/ErrorBoundary/index.tsx | 3 +- .../Form/components/FileInput/FileInput.tsx | 6 +- .../FileInput/_components/FileAttachDemo.tsx | 16 +- .../FileInput/_components/FileInputButton.tsx | 26 +- .../FileInput/_components/FileUpload.tsx | 20 +- .../_components/FormFileInputButton.tsx | 22 +- .../_components/FormWithFileInput.tsx | 16 +- .../components/FileInput/_components/index.ts | 2 +- .../Form/components/FormInput/FormInput.tsx | 52 +- .../components/FormInput/FormInputFields.tsx | 80 +-- .../Form/components/LoginForm/LoginForm.tsx | 6 +- .../components/LoginForm/LoginFormFields.tsx | 10 +- apps/demo/src/Views/Form/index.ts | 2 +- apps/demo/src/Views/Form/pages.tsx | 22 +- .../src/Views/Home/components/Package.tsx | 6 +- apps/demo/src/Views/Home/index.tsx | 18 +- apps/demo/src/Views/I18n/index.ts | 2 +- apps/demo/src/Views/I18n/pages.tsx | 6 +- .../StickyCollapsibleFooterDemo.tsx | 22 +- apps/demo/src/Views/Layout/index.ts | 2 +- apps/demo/src/Views/Layout/pages.tsx | 14 +- .../src/Views/Ui/components/AccordionDemo.tsx | 36 +- .../src/Views/Ui/components/Button/Button.tsx | 52 +- .../Views/Ui/components/Button/components.tsx | 52 +- .../demo/src/Views/Ui/components/CardDemo.tsx | 20 +- .../Views/Ui/components/ConfirmationModal.tsx | 10 +- .../CountryDisplay/CountryDisplayDemo.tsx | 50 +- .../Ui/components/DataComponent/index.tsx | 26 +- .../Views/Ui/components/DropdownMenuDemo.tsx | 18 +- .../Views/Ui/components/EditableTitleDemo.tsx | 52 +- .../src/Views/Ui/components/ExportButton.tsx | 6 +- .../demo/src/Views/Ui/components/FileCard.tsx | 18 +- .../src/Views/Ui/components/FilesList.tsx | 28 +- .../Views/Ui/components/FilesPresentation.tsx | 74 +- .../src/Views/Ui/components/FilesTable.tsx | 56 +- .../Ui/components/FormWidgets/Checkbox.tsx | 4 +- .../components/FormWidgets/CheckboxInput.tsx | 64 +- .../FormWidgets/CheckboxInputUsage.tsx | 52 +- .../components/FormWidgets/CountryPicker.tsx | 64 +- .../components/FormWidgets/CurrencyPicker.tsx | 24 +- .../Views/Ui/components/FormWidgets/Input.tsx | 10 +- .../Ui/components/FormWidgets/Select.tsx | 218 +++--- .../Ui/components/FormWidgets/SwitchInput.tsx | 22 +- .../FormWidgets/SwitchInputUsage.tsx | 4 +- .../Ui/components/FormWidgets/Textarea.tsx | 10 +- .../Ui/components/FormWidgets/Typeahead.tsx | 64 +- .../Views/Ui/components/FormWidgets/index.ts | 2 +- .../Views/Ui/components/GridContainerDemo.tsx | 22 +- .../Views/Ui/components/InlineLinkDemo.tsx | 22 +- apps/demo/src/Views/Ui/components/Loading.tsx | 8 +- apps/demo/src/Views/Ui/components/Message.tsx | 10 +- .../src/Views/Ui/components/ModalDemo.tsx | 40 +- .../demo/src/Views/Ui/components/PageDemo.tsx | 28 +- apps/demo/src/Views/Ui/components/Popup.tsx | 10 +- .../src/Views/Ui/components/SortableList.tsx | 12 +- .../Views/Ui/components/Stepper/Stepper.tsx | 29 +- .../src/Views/Ui/components/SubmitButton.tsx | 12 +- .../Ui/components/TabView/TabViewDemo.tsx | 252 +++---- .../Ui/components/TabbedPanel/TabbedPanel.tsx | 10 +- .../Ui/components/TabbedPanel/components.tsx | 2 +- .../src/Views/Ui/components/Table/Table.tsx | 408 +++++------ .../src/Views/Ui/components/Table/data.ts | 206 +++--- apps/demo/src/Views/Ui/components/Tag/Tag.tsx | 33 +- .../Views/Ui/components/Tooltip/Tooltip.tsx | 19 +- .../YoutubeFacade/YoutubeFacade.tsx | 20 +- .../Ui/components/YoutubeFacade/demo.tsx | 10 +- apps/demo/src/Views/Ui/pages.tsx | 202 +++--- .../Views/User/components/AllUsersTable.tsx | 6 +- .../InvitationForm/InvitationForm.tsx | 14 +- .../Views/User/components/InvitationModal.tsx | 4 +- .../User/components/InvitationsTable.tsx | 34 +- .../src/Views/User/components/UsersTable.tsx | 22 +- apps/demo/src/Views/User/components/data.ts | 376 +++++----- apps/demo/src/Views/User/pages.tsx | 30 +- apps/demo/src/components/Demo/CodeBlock.tsx | 12 +- apps/demo/src/components/Demo/Demo.tsx | 10 +- apps/demo/src/components/Demo/Section.tsx | 8 +- apps/demo/src/components/Demo/index.ts | 2 +- apps/demo/src/config.ts | 6 +- apps/demo/src/layouts/BasicLayout.tsx | 4 +- apps/demo/src/locales/en/index.ts | 2 +- apps/demo/src/locales/fr/index.ts | 2 +- apps/demo/src/main.tsx | 6 +- apps/demo/src/redux/hooks.ts | 5 +- apps/demo/src/redux/store.ts | 4 +- apps/demo/src/types.ts | 2 +- apps/demo/vite.config.ts | 9 +- packages/config/package.json | 2 +- .../config/src/context/ConfigProvider.tsx | 4 +- packages/config/src/index.ts | 4 +- packages/config/src/types.ts | 4 +- packages/config/src/utils/index.ts | 4 +- packages/config/vite.config.ts | 5 +- packages/form/package.json | 2 +- .../form/src/components/CheckboxInput.tsx | 8 +- .../form/src/components/CurrencyPicker.tsx | 46 +- packages/form/src/components/DateInput.tsx | 30 +- packages/form/src/components/DatePicker.tsx | 6 +- packages/form/src/components/DaysInput.tsx | 4 +- packages/form/src/components/Email.tsx | 20 +- .../File/FileAttach/FileAttachBasic.tsx | 19 +- .../File/FileDropzone/FileDropzone.tsx | 30 +- .../File/FileDropzone/FileDropzoneBasic.tsx | 53 +- .../components/File/FileInput/FileInput.tsx | 38 +- .../File/FileInput/FileInputBasic.tsx | 41 +- .../File/FileInput/FormFileInput.tsx | 38 +- .../src/components/File/FileInput/index.ts | 2 +- .../components/File/FileUpload/FileUpload.tsx | 27 +- .../File/SelectedFile/SelectedFile.tsx | 30 +- packages/form/src/components/File/hooks.ts | 10 +- packages/form/src/components/File/types.ts | 82 +-- packages/form/src/components/Form.tsx | 30 +- packages/form/src/components/FormActions.tsx | 2 +- packages/form/src/components/FormProvider.tsx | 16 +- packages/form/src/components/NumberInput.tsx | 16 +- packages/form/src/components/Password.tsx | 10 +- packages/form/src/components/RadioInput.tsx | 10 +- packages/form/src/components/Select.tsx | 48 +- packages/form/src/components/SwitchInput.tsx | 12 +- packages/form/src/components/TextInput.tsx | 28 +- packages/form/src/components/Textarea.tsx | 28 +- packages/form/src/components/Typeahead.tsx | 50 +- packages/form/src/components/index.ts | 4 +- packages/form/src/hooks/index.ts | 4 +- packages/form/src/schemas/Password.ts | 10 +- packages/form/src/types/index.ts | 62 +- .../validator/strong-password-options.ts | 44 +- packages/form/vite.config.ts | 15 +- packages/i18n/eslint.config.js | 2 +- packages/i18n/package.json | 2 +- .../src/components/LocaleSwitcher/index.tsx | 4 +- .../component/LocaleSwitcher.test.tsx | 10 +- .../snapshot/LocalSwitcher.snapshot.test.tsx | 8 +- packages/i18n/src/index.ts | 12 +- packages/i18n/src/plugin.ts | 4 +- packages/i18n/vite.config.ts | 13 +- packages/layout/eslint.config.js | 2 +- packages/layout/package.json | 2 +- packages/layout/setup-test.ts | 2 +- .../src/components/Layout/Header/Header.tsx | 16 +- .../components/Layout/Header/HeaderMenu.tsx | 4 +- .../components/Layout/Header/HeaderTitle.tsx | 2 +- .../layout/src/components/Layout/Layout.tsx | 4 +- .../src/components/Layout/Sidebar/Sidebar.tsx | 10 +- .../components/Layout/common/Copyright.tsx | 2 +- .../src/components/Layout/common/Logo.tsx | 2 +- .../Layout/common/UserMenu/UserMenu.tsx | 14 +- .../__test__/Copyright.snapshot.test.tsx | 10 +- .../__test__/Version.snapshot.test.tsx | 10 +- packages/layout/src/index.ts | 31 +- packages/layout/src/layouts/HeaderLayout.tsx | 24 +- .../src/layouts/SidebarHeaderLayout.tsx | 12 +- .../layout/src/layouts/SidebarOnlyLayout.tsx | 18 +- packages/layout/src/layouts/index.ts | 2 +- packages/layout/src/types/user-menu.ts | 8 +- packages/layout/vite.config.ts | 13 +- packages/ui/package.json | 2 +- packages/ui/src/Accordion/Accordion.tsx | 28 +- .../src/Accordion/__test__/Accordion.test.tsx | 18 +- packages/ui/src/Buttons/ButtonBasic/index.tsx | 24 +- .../ui/src/Buttons/ExportButton/index.tsx | 22 +- .../ui/src/Buttons/SubmitButton/index.tsx | 4 +- packages/ui/src/Buttons/index.ts | 2 +- packages/ui/src/Card/Card.tsx | 4 +- .../__test__/ConfirmationModal.test.tsx | 35 +- packages/ui/src/ConfirmationModal/index.tsx | 30 +- packages/ui/src/CountryDisplay/index.tsx | 7 +- .../src/Data/__test__/Data.snapshot.test.tsx | 6 +- packages/ui/src/Data/index.tsx | 6 +- packages/ui/src/Divider/index.tsx | 2 +- packages/ui/src/DropdownMenu/Menu.tsx | 16 +- .../__test__/DropdownMenu.snapshot.test.tsx | 6 +- packages/ui/src/DropdownMenu/index.tsx | 24 +- packages/ui/src/EditableTitle/index.tsx | 22 +- .../src/FileCard/ConfirmationFileActions.tsx | 60 +- packages/ui/src/FileCard/index.tsx | 82 +-- packages/ui/src/FilesList/index.tsx | 44 +- packages/ui/src/FilesPresentation/index.tsx | 30 +- packages/ui/src/FilesTable/index.tsx | 124 ++-- .../Checkbox/__test__/Checkbox.test.tsx | 8 +- .../ui/src/FormWidgets/Checkbox/index.tsx | 2 +- .../__test__/CheckboxInput.test.tsx | 18 +- .../src/FormWidgets/CheckboxInput/index.tsx | 32 +- .../__test__/CountryPicker.snapshot.test.tsx | 14 +- .../src/FormWidgets/CountryPicker/index.tsx | 30 +- .../src/FormWidgets/CurrencyPicker/index.tsx | 25 +- .../ui/src/FormWidgets/DatePicker/index.tsx | 10 +- .../src/FormWidgets/DebouncedInput/index.tsx | 16 +- .../FormWidgets/Input/__test__/Input.test.tsx | 18 +- packages/ui/src/FormWidgets/Input/index.tsx | 20 +- .../__test__/RadioInput.snapshot.test.tsx | 4 +- .../ui/src/FormWidgets/RadioInput/index.tsx | 14 +- .../Select/__test__/Select.snapshot.test.tsx | 36 +- packages/ui/src/FormWidgets/Select/index.tsx | 119 ++- .../ui/src/FormWidgets/SwitchInput/index.tsx | 6 +- .../TextArea/__test__/TextArea.test.tsx | 2 +- .../ui/src/FormWidgets/TextArea/index.tsx | 12 +- .../ui/src/FormWidgets/Typeahead/index.tsx | 40 +- packages/ui/src/FormWidgets/index.tsx | 2 +- packages/ui/src/GridContainer/index.tsx | 4 +- .../InlineLink/__test__/InlineLink.test.tsx | 11 +- packages/ui/src/InlineLink/index.tsx | 8 +- packages/ui/src/LoadingIcon/index.tsx | 8 +- packages/ui/src/LoadingPage/index.tsx | 4 +- .../ui/src/Message/__test__/Message.test.tsx | 9 +- packages/ui/src/Message/index.tsx | 10 +- packages/ui/src/Modal/__test__/Modal.test.tsx | 19 +- packages/ui/src/Modal/index.tsx | 6 +- packages/ui/src/NavigationMenu/NavGroup.tsx | 24 +- packages/ui/src/NavigationMenu/NavItem.tsx | 12 +- packages/ui/src/NavigationMenu/Navigation.tsx | 6 +- .../ui/src/NavigationMenu/NavigationMenu.tsx | 6 +- packages/ui/src/NavigationMenu/types.ts | 36 +- packages/ui/src/Page/Header.tsx | 12 +- .../src/Page/__test__/Page.snapsot.test.tsx | 4 +- packages/ui/src/Page/__test__/Page.test.tsx | 10 +- packages/ui/src/Page/index.tsx | 16 +- packages/ui/src/Pagination/index.tsx | 58 +- packages/ui/src/Popup/Popup.tsx | 40 +- packages/ui/src/Popup/PopupMenu.tsx | 10 +- .../ui/src/SSOButtons/BaseButton/index.tsx | 6 +- .../src/SSOButtons/FacebookButton/index.tsx | 2 +- .../ui/src/SSOButtons/GoogleButton/index.tsx | 2 +- packages/ui/src/SortableList/SortableList.tsx | 30 +- packages/ui/src/Stepper/Step.tsx | 26 +- packages/ui/src/Stepper/index.tsx | 44 +- packages/ui/src/TabView/index.tsx | 24 +- packages/ui/src/TabView/types.ts | 42 +- packages/ui/src/TabView/utilities.ts | 8 +- packages/ui/src/TabbedPanel/TabbedPanel.tsx | 26 +- .../TabbedPanel/__test__/TabbedPanel.test.tsx | 14 +- packages/ui/src/TabbedPanel/index.ts | 2 +- packages/ui/src/TabbedPanel/types.ts | 24 +- packages/ui/src/TabbedPanel/utilities.ts | 15 +- packages/ui/src/Table/Table.tsx | 119 +-- packages/ui/src/Table/TableBody.tsx | 58 +- packages/ui/src/Table/TableDataActions.tsx | 28 +- packages/ui/src/Table/TableDateFilter.tsx | 8 +- packages/ui/src/Table/TableElements.tsx | 18 +- packages/ui/src/Table/TableHeader.tsx | 66 +- packages/ui/src/Table/TableRangeFilter.tsx | 6 +- packages/ui/src/Table/TableToolbar.tsx | 31 +- .../ui/src/Table/__test__/TestTableData.tsx | 2 +- .../src/Table/__test__/unit/utilities.test.ts | 12 +- packages/ui/src/Table/enums.ts | 30 +- packages/ui/src/Table/index.ts | 10 +- packages/ui/src/Table/types.ts | 338 ++++----- packages/ui/src/Table/utilities.ts | 97 +-- packages/ui/src/Tag/index.tsx | 15 +- packages/ui/src/Tooltip/ConfigureTooltip.ts | 6 +- packages/ui/src/Tooltip/Tooltip.tsx | 32 +- packages/ui/src/Tooltip/index.tsx | 4 +- .../ui/src/components/SubPane/SubPane.tsx | 2 +- packages/ui/src/index.ts | 16 +- packages/ui/src/types/country-picker.ts | 12 +- packages/ui/src/types/index.ts | 2 +- packages/ui/src/types/menu.ts | 8 +- packages/ui/src/utils/UseDebouncedValue.ts | 2 +- packages/ui/src/utils/UseExporter.ts | 26 +- packages/ui/src/utils/UseExporterAsync.ts | 26 +- .../src/utils/__test__/country-picker.test.ts | 32 +- packages/ui/src/utils/__test__/date.test.ts | 4 +- packages/ui/src/utils/country-picker.ts | 8 +- packages/ui/src/utils/date.ts | 6 +- packages/ui/vite.config.ts | 15 +- packages/user/eslint.config.js | 2 +- packages/user/package.json | 2 +- packages/user/setup-test.ts | 4 +- packages/user/src/api/user/index.ts | 4 +- .../ChangePasswordFormFields.tsx | 12 +- .../components/ChangePasswordForm/index.tsx | 18 +- .../ForgotPasswordFormFields.tsx | 8 +- .../components/ForgotPasswordForm/index.tsx | 18 +- .../components/Invitation/InvitationForm.tsx | 36 +- .../Invitation/InvitationFormFields.tsx | 34 +- .../components/Invitation/InvitationModal.tsx | 8 +- .../Invitation/InvitationsTable.tsx | 106 +-- .../user/src/components/Login/LoginForm.tsx | 8 +- .../src/components/Login/LoginFormFields.tsx | 12 +- .../src/components/Login/LoginWrapper.tsx | 12 +- .../src/components/Profile/AccountInfo.tsx | 12 +- .../src/components/Profile/ProfileForm.tsx | 10 +- .../components/Profile/ProfileFormFields.tsx | 14 +- .../components/Profile/UpdateEmailForm.tsx | 62 +- .../Profile/UpdateEmailFormFields.tsx | 6 +- .../components/Profile/UpdateEmailModal.tsx | 10 +- packages/user/src/components/Profile/index.ts | 2 +- .../src/components/RedirectionMessage.tsx | 2 +- .../ResetPasswordFormFields.tsx | 10 +- .../components/ResetPasswordForm/index.tsx | 14 +- .../user/src/components/Signup/SignupForm.tsx | 28 +- .../components/Signup/SignupFormFields.tsx | 30 +- .../src/components/Signup/SignupWrapper.tsx | 22 +- .../components/Signup/TermsAndConditions.tsx | 6 +- .../SocialLogin/AuthSocialLoginCallback.tsx | 4 +- .../components/UsersTable/AllUsersTable.tsx | 130 ++-- .../src/components/UsersTable/UsersTable.tsx | 144 ++-- .../user/src/components/UsersTable/index.ts | 2 +- .../components/__test__/LoginForm.test.tsx | 2 +- .../__test__/SignupForm.snapshot.test.tsx | 2 +- .../components/__test__/SignupForm.test.tsx | 6 +- packages/user/src/components/index.ts | 4 +- packages/user/src/constants.ts | 26 +- packages/user/src/context/ConfigProvider.tsx | 2 +- packages/user/src/context/UserProvider.tsx | 8 +- packages/user/src/helpers/index.ts | 2 +- packages/user/src/hooks/useFirstUserSignup.ts | 10 +- .../user/src/hooks/useUserNavigationMenu.ts | 28 +- packages/user/src/index.ts | 21 +- .../src/layouts/UserEnabledHeaderLayout.tsx | 10 +- .../UserEnabledSidebarHeaderLayout.tsx | 8 +- .../layouts/UserEnabledSidebarOnlyLayout.tsx | 30 +- packages/user/src/main.tsx | 2 +- .../src/routes/ProtectedRoutesHandler.tsx | 8 +- .../src/routes/getUserProtectedRoutes.tsx | 20 +- .../user/src/routes/getUserPublicRoutes.tsx | 28 +- packages/user/src/routes/index.ts | 4 +- packages/user/src/supertokens/change-email.ts | 4 +- .../user/src/supertokens/change-password.ts | 4 +- packages/user/src/supertokens/helpers.ts | 2 +- packages/user/src/supertokens/index.ts | 2 +- packages/user/src/supertokens/login.ts | 2 +- .../supertokens/resend-email-verification.ts | 2 +- .../user/src/supertokens/reset-password.ts | 4 +- packages/user/src/supertokens/signup.ts | 4 +- packages/user/src/supertokens/superTokens.ts | 4 +- packages/user/src/supertokens/verify-email.ts | 2 +- packages/user/src/types/config.ts | 4 +- packages/user/src/types/invitation.ts | 44 +- packages/user/src/types/routes.ts | 18 +- packages/user/src/types/types.ts | 96 +-- packages/user/src/views/AcceptInvitation.tsx | 6 +- packages/user/src/views/ChangePassword.tsx | 2 +- .../src/views/EmailVerificationReminder.tsx | 8 +- packages/user/src/views/ForgotPassword.tsx | 6 +- packages/user/src/views/Login.tsx | 14 +- .../user/src/views/Profile/ProfilePage.tsx | 2 +- .../src/views/Profile/ProfileTabsPage.tsx | 16 +- .../src/views/ProfileCompletionReminder.tsx | 2 +- packages/user/src/views/ResetPassword.tsx | 4 +- packages/user/src/views/Signup.tsx | 14 +- packages/user/src/views/SignupFirstUser.tsx | 4 +- packages/user/src/views/VerifyEmail.tsx | 14 +- packages/user/vite.config.ts | 15 +- pnpm-lock.yaml | 676 +++++++++++++++++- 350 files changed, 4857 insertions(+), 4263 deletions(-) diff --git a/apps/demo/package.json b/apps/demo/package.json index 2206610bc..5927cc11a 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -40,7 +40,7 @@ "@babel/core": "7.26.10", "@babel/plugin-syntax-flow": "7.26.0", "@babel/plugin-transform-react-jsx": "^7.21.5", - "@prefabs.tech/eslint-config": "0.5.0", + "@prefabs.tech/eslint-config": "git+https://github.com/prefabs-tech/tools.git#refactor/eslint-config&path:packages/eslint-config", "@testing-library/react": "16.3.2", "@types/jsdom": "21.1.7", "@types/node": "25.3.5", diff --git a/apps/demo/setup-test.ts b/apps/demo/setup-test.ts index 3bb3c5cce..cd9a4146c 100644 --- a/apps/demo/setup-test.ts +++ b/apps/demo/setup-test.ts @@ -4,10 +4,10 @@ import { vi } from "vitest"; vi.mock("@prefabs.tech/react-i18n", () => ({ useTranslation: () => { return { - t: (string_) => string_, i18n: { changeLanguage: () => new Promise(() => {}), }, + t: (string_) => string_, }; }, })); diff --git a/apps/demo/src/Routers.tsx b/apps/demo/src/Routers.tsx index 1bf999f01..7efeecb35 100644 --- a/apps/demo/src/Routers.tsx +++ b/apps/demo/src/Routers.tsx @@ -28,70 +28,70 @@ import { const router = createBrowserRouter( [ { - path: "/", - element: , - errorElement: , children: [ { - index: true, element: , + index: true, }, { - path: "/ui", - element: , children: [ { - index: true, element: , + index: true, }, ...uiRoutes, ], + element: , + path: "/ui", }, { - path: "/user", - element: , children: [ { - index: true, element: , + index: true, }, ...userRoutes, ], + element: , + path: "/user", }, { - path: "/form", - element: , children: [ { - index: true, element: , + index: true, }, ...formRoutes, ], + element: , + path: "/form", }, { - path: "/layout", - element: , children: [ { - index: true, element: , + index: true, }, ...layoutRoutes, ], + element: , + path: "/layout", }, { - path: "/i18n", - element: , children: [ { - index: true, element: , + index: true, }, ...i18nRoutes, ], + element: , + path: "/i18n", }, ], + element: , + errorElement: , + path: "/", }, ], { diff --git a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx index 3754d57d0..ea7f43c18 100644 --- a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx +++ b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx @@ -5,7 +5,7 @@ import ErrorBoundary from "../index"; vi.mock("react-router-dom", async () => ({ ...(await vi.importActual("react-router-dom")), - useRouteError: () => ({ statusText: 404, message: "Not Found" }), + useRouteError: () => ({ message: "Not Found", statusText: 404 }), })); test("Component matches snapshot", async () => { diff --git a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx index 2dbb53fa0..9404443ed 100644 --- a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx +++ b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx @@ -5,7 +5,7 @@ import ErrorBoundary from "../index"; vi.mock("react-router-dom", async () => ({ ...(await vi.importActual("react-router-dom")), - useRouteError: () => ({ statusText: 404, message: "Not Found" }), + useRouteError: () => ({ message: "Not Found", statusText: 404 }), })); test("show error when loader throws error", async () => { diff --git a/apps/demo/src/Views/ErrorBoundary/index.tsx b/apps/demo/src/Views/ErrorBoundary/index.tsx index bdcf10038..0d4507020 100644 --- a/apps/demo/src/Views/ErrorBoundary/index.tsx +++ b/apps/demo/src/Views/ErrorBoundary/index.tsx @@ -1,11 +1,12 @@ import { useTranslation } from "@prefabs.tech/react-i18n"; import { Page } from "@prefabs.tech/react-ui"; import { useRouteError } from "react-router-dom"; + import "./ErrorBoundary.css"; type RouteError = { - statusText?: string; message?: string; + statusText?: string; }; const ErrorBoundary = (): JSX.Element => { diff --git a/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx b/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx index 3cd944adf..922d43d06 100644 --- a/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx +++ b/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx @@ -2,6 +2,7 @@ import { useTranslation } from "@prefabs.tech/react-i18n"; import { Button, Page } from "@prefabs.tech/react-ui"; import { useNavigate } from "react-router-dom"; +import { Section } from "../../../../components/Demo"; import { FileAttachDemo, FileInputButton, @@ -9,7 +10,6 @@ import { FormWithFileInput, FormWithFileInputButton, } from "./_components"; -import { Section } from "../../../../components/Demo"; export const FileInputDemo = () => { const [t] = useTranslation("form"); @@ -21,10 +21,10 @@ export const FileInputDemo = () => { title={t("fileInput.title")} toolbar={