refactor(frontend): fix eslint
This commit is contained in:
parent
5b91157e6c
commit
f19b7e231f
@ -81,8 +81,6 @@ export default [
|
||||
'jsx-a11y/click-events-have-key-events': 'off',
|
||||
'jsx-a11y/no-static-element-interactions': 'off',
|
||||
'jsx-a11y/no-noninteractive-element-interactions': 'off',
|
||||
'@stylistic/indent': 'off',
|
||||
'@stylistic/jsx-one-expression-per-line': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -96,6 +94,7 @@ export default [
|
||||
'**/*.test.tsx',
|
||||
'**/__tests__/**',
|
||||
'**/tests/**',
|
||||
'__mocks__/**',
|
||||
],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"@types/jest": "30.0.0",
|
||||
"@types/react": "19.1.9",
|
||||
"@types/react-dom": "19.1.7",
|
||||
"@typescript-eslint/parser": "8.39.0",
|
||||
"@typescript-eslint/parser": "8.42.0",
|
||||
"eslint": "9.34.0",
|
||||
"eslint-config-ksv741": "0.2.0",
|
||||
"identity-obj-proxy": "3.0.0",
|
||||
@ -45,5 +45,14 @@
|
||||
"openapi-typescript": "7.9.1",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.9.2"
|
||||
},
|
||||
"overrides": {
|
||||
"@stylistic/eslint-plugin": "5.3.1",
|
||||
"typescript-eslint": "8.42.0"
|
||||
},
|
||||
"msw": {
|
||||
"workerDirectory": [
|
||||
"public"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import { Input } from '@/shared/ui/Input';
|
||||
import classes from './AddExpenseItemForm.module.css';
|
||||
|
||||
import type {
|
||||
FC,
|
||||
FC,
|
||||
FormEventHandler,
|
||||
FormHTMLAttributes,
|
||||
RefObject,
|
||||
|
||||
@ -58,7 +58,7 @@ describe('Test EditExpenseItemForm', () => {
|
||||
|
||||
test('should inputs have default value', () => {
|
||||
const {
|
||||
titleInputElem,
|
||||
titleInputElem,
|
||||
descriptionInputElem,
|
||||
dateInputElem,
|
||||
amountInputElem,
|
||||
|
||||
@ -4,7 +4,7 @@ import classes from './EditExpenseItemForm.module.css';
|
||||
|
||||
import type { ExpenseListItem } from '../../types';
|
||||
import type {
|
||||
FC,
|
||||
FC,
|
||||
FormEventHandler,
|
||||
FormHTMLAttributes,
|
||||
RefObject,
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import type { ExpenseList } from '@/entity/expenses/list';
|
||||
import type {
|
||||
FC, FormEventHandler, FormHTMLAttributes, RefObject,
|
||||
FC,
|
||||
FormEventHandler,
|
||||
FormHTMLAttributes,
|
||||
RefObject,
|
||||
} from 'react';
|
||||
|
||||
type BaseFormProps = Omit<FormHTMLAttributes<HTMLFormElement>, 'onSubmit'>;
|
||||
@ -34,7 +37,9 @@ const DeleteExpensesListForm: FC<DeleteExpenseListFormProps> = (props) => {
|
||||
Вы действительно хотите удалить список расходов
|
||||
{' '}
|
||||
|
||||
<b>{`"${list.title}"`}</b>
|
||||
<b>
|
||||
{`"${list.title}"`}
|
||||
</b>
|
||||
|
||||
{' '}
|
||||
?
|
||||
@ -47,7 +52,9 @@ const DeleteExpensesListForm: FC<DeleteExpenseListFormProps> = (props) => {
|
||||
В нем содержится
|
||||
{' '}
|
||||
|
||||
<b>{list.items?.length}</b>
|
||||
<b>
|
||||
{list.items?.length}
|
||||
</b>
|
||||
|
||||
{' '}
|
||||
расходов
|
||||
|
||||
@ -3,8 +3,8 @@ import { useLogout } from '@/entity/account';
|
||||
const LogoutButton = () => {
|
||||
const { mutate: logout, isPending } = useLogout();
|
||||
|
||||
const onClickHandler = async () => {
|
||||
await logout();
|
||||
const onClickHandler = () => {
|
||||
logout();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@ -31,15 +31,15 @@ const EditExpenseItemButton: FC<EditExpenseItemButtonProps> = (props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
ref={ref}
|
||||
disabled={isPending}
|
||||
type="button"
|
||||
onClick={onClickHandler}
|
||||
{...restProps}
|
||||
>
|
||||
Редактировать
|
||||
</button>
|
||||
<button
|
||||
ref={ref}
|
||||
disabled={isPending}
|
||||
type="button"
|
||||
onClick={onClickHandler}
|
||||
{...restProps}
|
||||
>
|
||||
Редактировать
|
||||
</button>
|
||||
|
||||
<Modal open={isOpen} onClose={onCloseModalHandler}>
|
||||
<EditExpenseItemForm disabled={isPending} item={item} onSubmit={onFormSubmitHandler} />
|
||||
|
||||
@ -24,9 +24,9 @@ const EditExpensesListButton: FC<EditExpensesListButtonProps> = (props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<button type="button" onClick={onClickHandler} {...restProps}>
|
||||
Редактировать
|
||||
</button>
|
||||
<button type="button" onClick={onClickHandler} {...restProps}>
|
||||
Редактировать
|
||||
</button>
|
||||
|
||||
<Modal open={isOpen} onClose={onCloseModalHandler}>
|
||||
<EditExpensesListForm disabled={isPending} list={list} onSubmit={onFormSubmitHandler} />
|
||||
|
||||
@ -16,63 +16,63 @@ const ExpenseItemsTable: FC<ExpenseItemsTableProps> = (props) => {
|
||||
return (
|
||||
<table className={classes.table}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Идентификатор</th>
|
||||
<tr>
|
||||
<th>Идентификатор</th>
|
||||
|
||||
<th>Название</th>
|
||||
<th>Название</th>
|
||||
|
||||
<th>Описание</th>
|
||||
<th>Описание</th>
|
||||
|
||||
<th>Дата</th>
|
||||
<th>Дата</th>
|
||||
|
||||
<th>Сумма</th>
|
||||
<th>Сумма</th>
|
||||
|
||||
<th>Валюта</th>
|
||||
<th>Валюта</th>
|
||||
|
||||
<th>Количество</th>
|
||||
<th>Количество</th>
|
||||
|
||||
<th>Действия</th>
|
||||
</tr>
|
||||
<th>Действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{items?.map((item) => (
|
||||
<tr key={item.id}>
|
||||
<td>
|
||||
{item.id}
|
||||
</td>
|
||||
{items?.map((item) => (
|
||||
<tr key={item.id}>
|
||||
<td>
|
||||
{item.id}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.title}
|
||||
</td>
|
||||
<td>
|
||||
{item.title}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.description}
|
||||
</td>
|
||||
<td>
|
||||
{item.description}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.date}
|
||||
</td>
|
||||
<td>
|
||||
{item.date}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.amount}
|
||||
</td>
|
||||
<td>
|
||||
{item.amount}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.currency}
|
||||
</td>
|
||||
<td>
|
||||
{item.currency}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{item.count}
|
||||
</td>
|
||||
<td>
|
||||
{item.count}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<EditExpenseItemButton item={item} />
|
||||
<td>
|
||||
<EditExpenseItemButton item={item} />
|
||||
|
||||
<DeleteExpenseItemButton item={item} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
<DeleteExpenseItemButton item={item} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user