Skip to content

Commit

Permalink
Merge pull request #38 from OriginProtocol/chore/eslint
Browse files Browse the repository at this point in the history
Chore/Update deps, fix eslint
  • Loading branch information
toniocodo authored Sep 14, 2023
2 parents b5d3562 + 08ef8d3 commit 9721f0e
Show file tree
Hide file tree
Showing 20 changed files with 2,488 additions and 2,478 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"rules": {}
},
{
"files": ["*.generated.ts", "*.generated.tsx"],
"files": ["*.generated.ts", "*.generated.tsx", "graphql.ts"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
2 changes: 1 addition & 1 deletion apps/oeth/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Container, CssBaseline, Stack } from '@mui/material';
import { registerChart } from '@origin/shared/providers';
import { Outlet } from 'react-router-dom';

import { Topnav } from './components/Topnav';
import { registerChart } from '@origin/shared/providers';

registerChart();

Expand Down
6 changes: 4 additions & 2 deletions libs/oeth/history/src/components/ChartCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ChartCard } from './ChartCard';
import { Container } from '@mui/material';

import { ChartCard } from './ChartCard';

import type { Meta, StoryObj } from '@storybook/react';

const meta: Meta<typeof ChartCard> = {
component: ChartCard,
title: 'History/ChartCard',
Expand Down
8 changes: 4 additions & 4 deletions libs/oeth/history/src/components/ChartCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Box, Stack, Typography, useTheme } from '@mui/material';
import { Card } from '@origin/shared/components';
import React, { useLayoutEffect, useRef } from 'react';
import { useIntl } from 'react-intl';
import React from 'react';

import { Stack, Typography, useTheme } from '@mui/material';
import { Card } from '@origin/shared/components';
import { Line } from 'react-chartjs-2';
import { useIntl } from 'react-intl';

interface Props {
apyPercent: number;
Expand Down
5 changes: 3 additions & 2 deletions libs/oeth/history/src/components/ExportData.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { useCallback, useMemo, useRef } from 'react';
import React, { useCallback, useRef } from 'react';

import { Box, Link } from '@mui/material';
import { useIntl } from 'react-intl';

import { HistoryFilterButton } from './HistoryButton';
import { Rows } from './HistoryTable';

import type { Rows } from './HistoryTable';

interface Props {
data?: Rows;
Expand Down
7 changes: 2 additions & 5 deletions libs/oeth/history/src/components/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';

import {
alpha,
Box,
Button,
Checkbox,
Divider,
FormControlLabel,
FormLabel,
MenuItem,
MenuList,
Popover,
Stack,
Typography,
alpha,
useTheme,
} from '@mui/material';
import {
Expand Down
7 changes: 4 additions & 3 deletions libs/oeth/history/src/components/HistoryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { useState } from 'react';

import { Box, Button, Divider, Stack, Typography } from '@mui/material';
import { useIntl } from 'react-intl';

import { graphqlClient } from '@origin/oeth/shared';
import { useQuery } from '@tanstack/react-query';
import { useIntl } from 'react-intl';
import { useAccount } from 'wagmi';

import {
HistoryTableDocument,
HistoryTableQuery,
HistoryTableWithFiltersDocument,
} from '../queries.generated';
import { ExportData } from './ExportData';
import { HistoryFilters } from './Filters';
import { HistoryTable } from './HistoryTable';

import type { HistoryTableQuery } from '../queries.generated';

const PAGE_SIZE = 20;

export function HistoryCard() {
Expand Down
23 changes: 11 additions & 12 deletions libs/oeth/history/src/components/HistoryCell.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { Stack, Typography } from '@mui/material';
import React from 'react';
import { TransactionIcon } from './TransactionIcon';

import { Stack, Typography } from '@mui/material';
import { useIntl } from 'react-intl';
import { useTransaction } from 'wagmi';
import {
decodeAbiParameters,
getAbiItem,
parseTransaction,
serializeTransaction,
} from 'viem';
import { contracts, tokens } from '@origin/shared/contracts';
import { omit } from 'ramda';

import { TransactionIcon } from './TransactionIcon';

import type { HexAddress } from '@origin/shared/utils';

interface Props {
timestamp: string;
Expand All @@ -20,8 +16,11 @@ interface Props {

export function HistoryCell(props: Props) {
const intl = useIntl();
// @ts-expect-error whatever
const { data } = useTransaction({ hash: props.transactionHash });

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data } = useTransaction({
hash: props.transactionHash as unknown as HexAddress,
});

return (
<Stack direction="row" alignItems="center" gap={1.5}>
Expand Down
3 changes: 2 additions & 1 deletion libs/oeth/history/src/components/TransactionIcon.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { TransactionIcon } from './TransactionIcon';

import type { Meta, StoryObj } from '@storybook/react';

const meta: Meta<typeof TransactionIcon> = {
component: TransactionIcon,
title: 'History/TransactionIcon',
Expand Down
3 changes: 2 additions & 1 deletion libs/oeth/history/src/components/TransactionIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box } from '@mui/material';
import React from 'react';

import { Box } from '@mui/material';

type Props =
| {
type: 'sent' | 'received' | 'yield';
Expand Down
2 changes: 1 addition & 1 deletion libs/oeth/history/src/views/HistoryView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HistoryCard } from '../components/HistoryCard';
import { APYContainer } from '../components/APYContainer';
import { HistoryCard } from '../components/HistoryCard';

export function HistoryView() {
return (
Expand Down
2 changes: 1 addition & 1 deletion libs/oeth/swap/src/views/SwapView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';

import { alpha, Box, IconButton, Stack } from '@mui/material';
import { ApyHeader } from '@origin/oeth/shared';
import { Card, TokenInput } from '@origin/shared/components';
import { ConnectedButton, usePrices } from '@origin/shared/providers';
import { isNilOrEmpty } from '@origin/shared/utils';
Expand All @@ -23,7 +24,6 @@ import type { IconButtonProps, Theme } from '@mui/material';
import type { Token } from '@origin/shared/contracts';

import type { TokenSource } from '../types';
import { ApyHeader } from '@origin/oeth/shared';

const commonStyles = {
paddingBlock: 2.5,
Expand Down
3 changes: 2 additions & 1 deletion libs/shared/components/src/Checkbox/EmptyCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SvgIcon } from '@mui/material';
import React from 'react';

import { SvgIcon } from '@mui/material';

export function EmptyCheckbox() {
return (
<SvgIcon>
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/components/src/LinkIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Link } from '@mui/material';

import type { LinkProps, SxProps } from '@mui/material';
import type { LinkProps } from '@mui/material';

interface Props extends LinkProps {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/components/src/top-nav/TopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function TopNav({
})}
onClick={() => setValue(0)}
>
<img src={logo} />
<img src={logo} alt="origin-logo" />
</Box>
<Tabs
onChange={(_, value) => setValue(value)}
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/providers/src/chart/registerChart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Chart as ChartJS,
CategoryScale,
Chart as ChartJS,
LinearScale,
LineElement,
PointElement,
Expand Down
11 changes: 9 additions & 2 deletions libs/shared/storybook/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { registerChart } from '@origin/shared/providers';
import {
CategoryScale,
Chart as ChartJS,
LinearScale,
LineElement,
PointElement,
} from 'chart.js';

import preview from './decorators';

registerChart();
ChartJS.register(CategoryScale, LinearScale, LineElement, PointElement);

export default preview;
89 changes: 45 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,81 @@
"storybook": "nx storybook shared-storybook",
"oeth": "pnpm nx serve oeth",
"ousd": "pnpm nx serve ousd",
"prepare": "husky install"
"prepare": "husky install",
"lint-fix": "pnpm nx run-many --target=lint -- --fix"
},
"private": true,
"lint-staged": {
"*.{js,jsx,ts,tsx,mdx}": "eslint --cache --fix"
},
"dependencies": {
"@curvefi/api": "^2.46.1",
"@curvefi/api": "^2.46.6",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.3",
"@rainbow-me/rainbowkit": "^1.0.10",
"@mui/material": "^5.14.9",
"@rainbow-me/rainbowkit": "^1.0.11",
"@react-hookz/web": "^23.1.0",
"@tanstack/react-query": "^4.32.6",
"@tanstack/react-table": "^8.9.3",
"@tanstack/react-query": "^4.35.3",
"@tanstack/react-table": "^8.9.9",
"@wagmi/core": "^1.4.1",
"axios": "^1.4.0",
"axios": "^1.5.0",
"chart.js": "^4.4.0",
"graphql": "^16.8.0",
"immer": "^10.0.2",
"ramda": "^0.29.0",
"react": "18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "18.2.0",
"react-intl": "^6.4.4",
"react-router-dom": "6.14.2",
"react-intl": "^6.4.6",
"react-router-dom": "6.16.0",
"react-tracked": "^1.7.11",
"tslib": "^2.6.1",
"viem": "^1.10.4",
"tslib": "^2.6.2",
"viem": "^1.10.12",
"wagmi": "^1.4.1"
},
"devDependencies": {
"@babel/preset-react": "^7.14.5",
"@babel/preset-react": "^7.22.15",
"@faker-js/faker": "^8.0.2",
"@formatjs/cli": "^6.1.3",
"@formatjs/cli": "^6.1.5",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/near-operation-file-preset": "^2.5.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-react-query": "^4.1.0",
"@nx/cypress": "16.6.0",
"@nx/eslint-plugin": "16.6.0",
"@nx/js": "16.6.0",
"@nx/linter": "16.6.0",
"@nx/react": "16.6.0",
"@nx/storybook": "16.6.0",
"@nx/vite": "16.6.0",
"@nx/web": "16.6.0",
"@nx/workspace": "16.6.0",
"@storybook/addon-essentials": "^7.2.1",
"@storybook/addon-interactions": "^7.2.1",
"@storybook/core-common": "^7.2.1",
"@storybook/core-server": "^7.2.1",
"@storybook/jest": "^0.1.0",
"@storybook/react": "^7.2.1",
"@storybook/react-vite": "^7.2.1",
"@nx/cypress": "16.8.1",
"@nx/eslint-plugin": "16.8.1",
"@nx/js": "16.8.1",
"@nx/linter": "16.8.1",
"@nx/react": "16.8.1",
"@nx/storybook": "16.8.1",
"@nx/vite": "16.8.1",
"@nx/web": "16.8.1",
"@nx/workspace": "16.8.1",
"@storybook/addon-essentials": "^7.4.1",
"@storybook/addon-interactions": "^7.4.1",
"@storybook/core-common": "^7.4.1",
"@storybook/core-server": "^7.4.1",
"@storybook/jest": "^0.2.2",
"@storybook/react": "^7.4.1",
"@storybook/react-vite": "^7.4.1",
"@storybook/testing-library": "^0.2.0",
"@testing-library/react": "14.0.0",
"@types/fs-extra": "^11.0.1",
"@types/node": "18.14.2",
"@types/ramda": "^0.29.3",
"@types/react": "18.2.18",
"@types/node": "20.6.0",
"@types/ramda": "^0.29.4",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@vitejs/plugin-react": "~4.0.4",
"@vitest/coverage-c8": "~0.33.0",
"@vitest/ui": "~0.34.1",
"babel-plugin-formatjs": "^10.5.3",
"@vitest/ui": "~0.34.4",
"babel-plugin-formatjs": "^10.5.5",
"buffer": "^6.0.3",
"eslint": "~8.48.0",
"eslint": "~8.49.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-formatjs": "^4.10.3",
"eslint-plugin-formatjs": "^4.10.5",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "^5.0.0",
Expand All @@ -92,16 +93,16 @@
"husky": "^8.0.0",
"jsdom": "~22.1.0",
"lint-staged": "^14.0.1",
"nx": "16.6.0",
"prettier": "^3.0.1",
"storybook-addon-pseudo-states": "^2.1.0",
"nx": "16.8.1",
"prettier": "^3.0.3",
"storybook-addon-pseudo-states": "^2.1.1",
"ts-node": "10.9.1",
"typescript": "~5.2.2",
"vite": "~4.4.9",
"vite-plugin-dts": "~3.5.1",
"vite-plugin-dts": "~3.5.3",
"vite-plugin-static-copy": "^0.17.0",
"vite-plugin-svgr": "^3.2.0",
"vite-tsconfig-paths": "~4.2.0",
"vitest": "~0.34.1"
"vite-tsconfig-paths": "~4.2.1",
"vitest": "~0.34.4"
}
}
Loading

0 comments on commit 9721f0e

Please sign in to comment.