From effa108c874c1cec9c99636c31ef0c0c3cffbc96 Mon Sep 17 00:00:00 2001 From: Paulo Victor Date: Tue, 23 Jan 2024 17:30:17 -0300 Subject: [PATCH] feat: path alias to electron and optimize src path (#342) * feat: path alias to electron and optimize src path * fix: eslint errors --- .eslintrc.cjs | 1 - src/App.tsx | 18 ++++---- src/components/Button/Button.stories.tsx | 14 +++--- .../FeedbackError/FeedbackError.stories.tsx | 3 +- .../FeedbackError/FeedbackError.tsx | 21 +++++---- src/components/Head/Head.tsx | 7 +-- .../Tabber/stores/useSocialNetworkStore.tsx | 43 +++++++++---------- src/components/Testinho/Testinho.tsx | 16 ++++--- src/pages/home/home.tsx | 8 ++-- tsconfig.json | 28 ++++-------- vite.config.ts | 8 ++-- 11 files changed, 82 insertions(+), 85 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1b77a5476..0430cb941 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -331,7 +331,6 @@ module.exports = defineConfig({ 'import/no-extraneous-dependencies': 'warn', 'import/no-named-as-default-member': 'warn', 'import/no-self-import': 'warn', - 'import/no-unresolved': 'warn', 'import/no-unused-modules': 'warn', 'import/order': 'off', // keep disable to not conflict with import-helpers/order-imports 'jsx-a11y/alt-text': 'warn', diff --git a/src/App.tsx b/src/App.tsx index a3fd8a221..b6cbb62fb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,16 +1,16 @@ -import React from 'react'; +import React, { ReactNode } from 'react'; import { - Route, - HashRouter as Router, - Routes, createRoutesFromChildren, + HashRouter as Router, matchRoutes, + Route, + Routes, useLocation, useNavigationType, } from 'react-router-dom'; import * as Sentry from '@sentry/react'; -import ModuleProvider from 'contexts/ModuleContext'; +import ModuleProvider from '~contexts/ModuleContext'; import Home from './pages/home/home'; @@ -32,21 +32,21 @@ Sentry.init({ ), }), ], - tracesSampleRate: 1.0, + replaysOnErrorSampleRate: 1, replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, + tracesSampleRate: 1, }); const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes); -function App() { +function App(): ReactNode { return (
- } /> + } path="/" />
diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx index 1498c1064..692c744f1 100644 --- a/src/components/Button/Button.stories.tsx +++ b/src/components/Button/Button.stories.tsx @@ -19,21 +19,21 @@ export const ButtonStories: Story = () => (