Skip to content

Commit

Permalink
[chore] eslint upgrade to version 9 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
sijav authored Aug 7, 2024
1 parent 4293751 commit 8eaeea5
Show file tree
Hide file tree
Showing 72 changed files with 1,709 additions and 1,377 deletions.
436 changes: 0 additions & 436 deletions .eslintrc.cjs

This file was deleted.

13 changes: 7 additions & 6 deletions .storybook/InnerBasicProviders.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { StoryContext } from '@storybook/react'
import { StoryContext, StrictArgs } from '@storybook/react'
import { FC, useEffect } from 'react'
import { BrowserRouter } from 'react-router-dom'
import { useThemeMode } from 'src/core/theme'
import { AbsoluteNavigateProvider } from 'src/shared/absolute-navigate'
import { AbsoluteNavigateContext } from 'src/shared/absolute-navigate'
import { i18n } from 'src/shared/providers'

export const InnerBasicProviders = ({ Story, context }: { Story: FC; context: StoryContext }) => {
export const InnerBasicProviders = ({ Story, context }: { Story: FC<StrictArgs>; context: StoryContext }) => {
const { theme: themeKey, lang } = context.globals as { theme: 'light' | 'dark'; lang: string }
const { toggleColorMode } = useThemeMode()

Expand All @@ -16,11 +16,12 @@ export const InnerBasicProviders = ({ Story, context }: { Story: FC; context: St
useEffect(() => {
toggleColorMode(themeKey)
}, [toggleColorMode, themeKey])

return (
<BrowserRouter>
<AbsoluteNavigateProvider>
<Story />
</AbsoluteNavigateProvider>
<AbsoluteNavigateContext.Provider value={() => {}}>
<Story {...context.args} />
</AbsoluteNavigateContext.Provider>
</BrowserRouter>
)
}
14 changes: 6 additions & 8 deletions .storybook/WithProviders.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { StoryContext } from '@storybook/react'
import { StoryContext, StrictArgs } from '@storybook/react'
import { FC } from 'react'
import { BasicProviders } from 'src/shared/providers'
import { InnerBasicProviders } from './InnerBasicProviders'

export const WithProviders = ({ Story, context }: { Story: FC; context: StoryContext }) => {
return (
<BasicProviders>
<InnerBasicProviders Story={Story} context={context} />
</BasicProviders>
)
}
export const WithProviders = ({ Story, context }: { Story: FC<StrictArgs>; context: StoryContext }) => (
<BasicProviders>
<InnerBasicProviders Story={Story} context={context} />
</BasicProviders>
)
17 changes: 8 additions & 9 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { langs } from 'src/shared/constants'
import { WithProviders } from './WithProviders'

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on.*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
// parameters: {
// controls: {
// matchers: {
// color: /(background|color)$/i,
// date: /Date$/i,
// },
// },
// },
globalTypes: {
theme: {
name: 'Theme',
Expand Down
Loading

0 comments on commit 8eaeea5

Please sign in to comment.