Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Oct 11, 2024
1 parent 5c11e8c commit 3d3e384
Show file tree
Hide file tree
Showing 38 changed files with 216 additions and 204 deletions.
7 changes: 5 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ export default [
workspacesConfig,
rulesConfig,
importConfig,
reactConfig,
{
rules: {
'@eslint-react/no-array-index-key': ['off']
'@eslint-react/no-array-index-key': ['warn'],
'@eslint-react/no-prop-types': ['warn'],
'@eslint-react/prefer-destructuring-assignment': ['warn'],
},
},
{
...typescriptConfig,
rules: {
...typescriptConfig.rules,
'@typescript-eslint/no-misused-promises': ['off'],
'@typescript-eslint/no-misused-promises': ['warn'],
'@typescript-eslint/consistent-type-imports': ['warn']
},
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@eslint-react/eslint-plugin": "^1.14.3",
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/addon-actions": "^8.3.5",
"@storybook/addon-docs": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
Expand Down Expand Up @@ -124,7 +124,7 @@
"storybook": "^8.3.5",
"storybook-dark-mode": "^4.0.2",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"vite": "^5.4.8"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@xylabs/react-button": "workspace:^"
},
"devDependencies": {
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/react-flexbox": "workspace:^",
Expand All @@ -50,7 +50,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
2 changes: 1 addition & 1 deletion packages/accordion/src/AccordionGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Default.args = {
name: 'Section 3',
},
],
defaultExpandedIndex: 1,
defaultExpandedName: 'Section 1',
}

export { Default }
Expand Down
10 changes: 5 additions & 5 deletions packages/accordion/src/AccordionGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ export type SimpleAccordionCardProps = Override<SimpleAccordionCardAdditionalPro

interface AccordionGroupProps {
data?: SimpleAccordionCardProps[]
defaultExpandedIndex?: number
defaultExpandedName?: string
}

export const AccordionGroup: React.FC<AccordionGroupProps> = ({ defaultExpandedIndex, data }) => {
const [expandedIndex, setExpandedIndex] = useState(defaultExpandedIndex ?? 0)
export const AccordionGroup: React.FC<AccordionGroupProps> = ({ defaultExpandedName, data }) => {
const [expandedName, setExpandedName] = useState(() => defaultExpandedName)

return (
<>
{data?.map((item, index) => (
<SimpleAccordion key={index} {...item} expanded={index === expandedIndex} onChange={() => setExpandedIndex(index)} />
{data?.map(item => (
<SimpleAccordion key={item.name} {...item} expanded={item.name === expandedName} onChange={() => setExpandedName(item.name)} />
))}
</>
)
Expand Down
4 changes: 2 additions & 2 deletions packages/animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"@xylabs/react-flexbox": "workspace:^"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
6 changes: 3 additions & 3 deletions packages/appbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"@xylabs/react-flexbox": "workspace:^"
},
"devDependencies": {
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
4 changes: 2 additions & 2 deletions packages/async-effect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
"@xylabs/react-promise": "workspace:^"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"react": "^18"
Expand Down
6 changes: 3 additions & 3 deletions packages/base-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"react-helmet": "^6.1.0"
},
"devDependencies": {
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@types/react-helmet": "^6.1.11",
Expand All @@ -56,7 +56,7 @@
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
4 changes: 2 additions & 2 deletions packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"react-router-dom": "^6.26.2"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/react-flexbox": "workspace:^",
Expand All @@ -51,7 +51,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
"react-router-dom": "^6.26.2"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
4 changes: 2 additions & 2 deletions packages/cookie-consent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
"@xylabs/react-shared": "workspace:^"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
8 changes: 4 additions & 4 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@
"ethers": "^6.13.3",
"lru-cache": "^11.0.1",
"react-router-dom": "^6.26.2",
"viem": "^2.21.19",
"viem": "^2.21.22",
"webextension-polyfill": "^0.12.0"
},
"devDependencies": {
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ export const WalletsDiscoveredMenuItems: React.FC<WalletsDiscoveredMenuItemsProp
}) => {
return (
discoveredWallets
? Object.values(discoveredWallets).map((eip6963Connector, index) => (
<WalletDiscoveryMenuItem key={index} ethWalletConnector={eip6963Connector} onClick={() => onWalletSelect?.(eip6963Connector)} {...props} />
? Object.values(discoveredWallets).map(eip6963Connector => (
<WalletDiscoveryMenuItem
key={eip6963Connector.providerName}
ethWalletConnector={eip6963Connector}
onClick={() => onWalletSelect?.(eip6963Connector)}
{...props}
/>
))
: suppressNoWalletsWarning
? null
Expand Down
4 changes: 2 additions & 2 deletions packages/dialogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"axios": "^1.7.7"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
Expand All @@ -51,7 +51,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
6 changes: 3 additions & 3 deletions packages/error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"@xylabs/react-flexbox": "workspace:^"
},
"devDependencies": {
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
1 change: 1 addition & 0 deletions packages/error/src/components/Errors/ErrorsViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ErrorsViewer: React.FC<ErrorsViewerProps> = (props) => {
return (
<FlexGrowCol padding={1} {...boxProps}>
{errors?.map((error, index) => {
// eslint-disable-next-line @eslint-react/no-array-index-key
return <ErrorViewer error={error} key={index} />
})}
{onRetry
Expand Down
4 changes: 2 additions & 2 deletions packages/experiments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
"@xylabs/react-shared": "workspace:^"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
2 changes: 1 addition & 1 deletion packages/flexbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
3 changes: 2 additions & 1 deletion packages/flexbox/src/components/BusyBox/BusyBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ const BusyBoxTemplate: StoryFn<typeof BusyBox> = args => <BusyBox {...args}></Bu

const BusyBoxMinimumTemplate: StoryFn<typeof BusyBox> = (args) => {
const [busyToggle, setBusyToggle] = useState(false)
const { busyMinimum } = args
return (
<>
<Typography variant="body1">
Busy mode should be at least
{(args?.busyMinimum || 0) / 1000}
{(busyMinimum || 0) / 1000}
{' '}
seconds
</Typography>
Expand Down
4 changes: 2 additions & 2 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"packages/*"
],
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@storybook/react": "^8.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.3.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/icons-material": "^6",
Expand Down
4 changes: 2 additions & 2 deletions packages/identicon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"md5": "^2.3.0"
},
"devDependencies": {
"@mui/material": "^6.1.2",
"@mui/material": "^6.1.3",
"@types/md5": "^2.3.5",
"@types/react": "^18.3.11",
"@xylabs/ts-scripts-yarn3": "^4.1.0",
"@xylabs/tsconfig-react": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"@mui/material": "^6",
Expand Down
Loading

0 comments on commit 3d3e384

Please sign in to comment.