Skip to content

Commit

Permalink
fix: linting error and warning in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
shahmargi12 committed Jul 24, 2024
1 parent 1858bda commit 5b81dcb
Show file tree
Hide file tree
Showing 76 changed files with 399 additions and 319 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ignorePatterns": ["*.test.tsx", "*.stories.tsx", "*.config.ts"],
"ignorePatterns": ["*.test.tsx", "*.config.ts"],
"env": {
"browser": true,
"es2021": true
Expand Down
9 changes: 5 additions & 4 deletions src/components/basic/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { Alert as Component } from '.'

Expand All @@ -30,9 +30,10 @@ export default {
children: {},
},
}
const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args}>{args.children}</Component>
)

const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args}>{args.children}</Component>

export const Alert = Template.bind({})
Alert.args = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/BaseImage/BaseImage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { BaseImage as Component } from '.'

Expand All @@ -28,9 +28,9 @@ export default {
tags: ['autodocs'],
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const BaseImage = Template.bind({})
BaseImage.args = {
Expand Down
22 changes: 14 additions & 8 deletions src/components/basic/Breadcrumb/Breadcrumb.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
********************************************************************************/

import { Link, Typography } from '@mui/material'
import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { Breadcrumb as Component } from '.'

Expand All @@ -36,7 +36,9 @@ const breadcrumbs = [
key="1"
color="inherit"
sx={{ cursor: 'pointer' }}
onClick={() => console.log('navigate to home')}
onClick={() => {
console.log('navigate to home')
}}
>
Home
</Link>,
Expand All @@ -45,7 +47,9 @@ const breadcrumbs = [
key="2"
color="inherit"
sx={{ cursor: 'pointer' }}
onClick={() => console.log('navigate to Breackcrumb 1')}
onClick={() => {
console.log('navigate to Breackcrumb 1')
}}
>
Breadcrumb 1
</Link>,
Expand All @@ -54,14 +58,16 @@ const breadcrumbs = [
</Typography>,
]

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const Breadcrumb = Template.bind({})
Breadcrumb.args = {
backButtonLabel: 'Back',
backButtonVariant: 'outlined',
onBackButtonClick: () => console.log('Back button clicked!'),
breadcrumbs: breadcrumbs,
onBackButtonClick: () => {
console.log('Back button clicked!')
},
breadcrumbs,
}
8 changes: 4 additions & 4 deletions src/components/basic/Button/BackButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import type { ComponentStory } from '@storybook/react'

import { BackButton as Component } from './BackButton'
import button from '../../../../docs/storybook/button.md?raw'
Expand All @@ -39,9 +39,9 @@ export default {
},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const BackButton = Template.bind({})
BackButton.args = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Button/LoadMoreButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { LoadMoreButton as Component } from './LoadMoreButton'

Expand All @@ -29,9 +29,9 @@ export default {
argTypes: {},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const LoadMoreButton = Template.bind({})
LoadMoreButton.args = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Button/ScrollToTopButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { ScrollToTopButton as Component } from './ScrollToTopButton'

Expand All @@ -33,9 +33,9 @@ export default {
},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const ScrollToTopButton = Template.bind({})
ScrollToTopButton.args = {
Expand Down
6 changes: 4 additions & 2 deletions src/components/basic/Carousel/Carousel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'
import { Carousel as Component } from '.'
import { theme } from '../../../theme'
import uniqueId from 'lodash/uniqueId'
Expand All @@ -40,7 +40,9 @@ const itemsArray = [
'Element 5',
]

const Template: ComponentStory<typeof Component> = (args: any) => (
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => (
<Component {...args}>
{itemsArray.map((item: string) => {
return (
Expand Down
6 changes: 4 additions & 2 deletions src/components/basic/Carousel/CarouselBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'
import { CarouselBox as Component } from './CarouselBox'
import { theme } from '../../../theme'
import uniqueId from 'lodash/uniqueId'
Expand All @@ -40,7 +40,9 @@ const itemsArray = [
'Element 5',
]

const Template: ComponentStory<typeof Component> = (args: any) => (
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => (
<Component {...args}>
{itemsArray.map((item: string) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { CategoryDivider as Component } from '.'

Expand All @@ -29,9 +29,9 @@ export default {
argTypes: {},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const CategoryDivider = Template.bind({})
CategoryDivider.args = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { Checkbox as Component } from '.'

Expand All @@ -33,9 +33,9 @@ export default {
},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const Checkbox = Template.bind({})
Checkbox.args = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Chip/DraggableChip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { DraggableChip as Component } from './DraggableChip'

Expand All @@ -33,8 +33,8 @@ export default {
},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args}>{args.children}</Component>
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args}>{args.children}</Component>

export const DraggableChip = Template.bind({})
16 changes: 10 additions & 6 deletions src/components/basic/Chip/chip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'
import { Chip as Component } from '.'

export default {
Expand All @@ -29,17 +29,21 @@ export default {
parameters: {},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const Chip = Template.bind({})
Chip.args = {
color: 'secondary',
variant: 'filled',
label: 'decline',
type: 'decline',
onClick: () => console.log('Decline clicked'),
onClick: () => {
console.log('Decline clicked')
},
withIcon: true,
handleDelete: () => console.log('onDelete clicked'),
handleDelete: () => {
console.log('onDelete clicked')
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ComponentStory } from '@storybook/react'
import { type ComponentStory } from '@storybook/react'

import { CircularProgress as Component } from '.'

Expand All @@ -28,8 +28,8 @@ export default {
tags: ['autodocs'],
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)
const Template: ComponentStory<typeof Component> = (
args: React.ComponentProps<typeof Component>
) => <Component {...args} />

export const Loading = Template.bind({})
Loading

0 comments on commit 5b81dcb

Please sign in to comment.