Skip to content

Commit

Permalink
chore: fix perfectionist eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrojcm committed Dec 10, 2024
1 parent 1d2c9b4 commit 44fd9c7
Show file tree
Hide file tree
Showing 129 changed files with 754 additions and 458 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:perfectionist/recommended-natural"
"plugin:perfectionist/recommended-natural-legacy",
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "perfectionist"],
Expand All @@ -17,8 +17,8 @@
{
"prefer": "type-imports",
"disallowTypeAnnotations": true,
"fixStyle": "inline-type-imports"
}
"fixStyle": "inline-type-imports",
},
],
"perfectionist/sort-imports": [
"warn",
Expand All @@ -32,12 +32,9 @@
"tanstack",
"mantine",
"mrt",
"siblings",
"sibling-type",
"parent",
"parent-type"
["sibling", "sibling-type", "parent", "parent-type"]
],
"custom-groups": {
"customGroups": {
"value": {
"clsx": "clsx",
"style": ["./**.module.css"],
Expand All @@ -46,16 +43,15 @@
"tanstack": "@tanstack/**",
"mantine": "@mantine/**",
"mrt": ["./MRT_**", "../**MRT_**", "../../src"],
"faker": "@faker/**"
"faker": "@faker/**",
},
"type": {
"react": "react"
}
"react": "react",
},
},
"newlines-between": "never"
}
]
},
],
},
"root": true,
"ignorePatterns": ["dist/", "locales/", "node_modules/"]
"ignorePatterns": ["dist/", "locales/", "node_modules/"],
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import clsx from 'clsx';

import classes from './MRT_TableBody.module.css';

import { memo, useMemo } from 'react';

import {
type TableProps,
TableTbody,
type TableTbodyProps,
} from '@mantine/core';
import { MRT_TableBodyRow, Memo_MRT_TableBodyRow } from './MRT_TableBodyRow';
import { useMRT_RowVirtualizer } from '../../hooks/useMRT_RowVirtualizer';

import { MRT_TableBodyEmptyRow } from './MRT_TableBodyEmptyRow';
import { Memo_MRT_TableBodyRow, MRT_TableBodyRow } from './MRT_TableBodyRow';

import { useMRT_Rows } from '../../hooks/useMRT_Rows';
import { useMRT_RowVirtualizer } from '../../hooks/useMRT_RowVirtualizer';
import {
type MRT_ColumnVirtualizer,
type MRT_Row,
Expand All @@ -17,7 +23,6 @@ import {
type MRT_VirtualItem,
} from '../../types';
import { parseFromValuesOrFunc } from '../../utils/utils';
import { MRT_TableBodyEmptyRow } from './MRT_TableBodyEmptyRow';

export interface MRT_TableBodyProps<TData extends MRT_RowData>
extends TableTbodyProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import clsx from 'clsx';

import classes from './MRT_TableBodyCell.module.css';

import {
type CSSProperties,
type DragEvent,
memo,
type MouseEvent,
type RefObject,
memo,
useEffect,
useState,
} from 'react';

import {
Skeleton,
TableTd,
type TableTdProps,
useDirection,
} from '@mantine/core';

import { MRT_TableBodyCellValue } from './MRT_TableBodyCellValue';

import {
type MRT_Cell,
type MRT_CellValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Highlight, type HighlightProps } from '@mantine/core';

import {
type MRT_Cell,
type MRT_CellValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import clsx from 'clsx';

import classes from './MRT_TableBody.module.css';

import { useMemo } from 'react';
import { type TableProps, Text, TableTd, TableTrProps } from '@mantine/core';

import { createRow } from '@tanstack/react-table';

import { type TableProps, TableTd, type TableTrProps, Text } from '@mantine/core';

import { MRT_TableBodyRow } from './MRT_TableBodyRow';

import {
type MRT_Row,
type MRT_RowData,
type MRT_TableInstance,
} from '../../types';
import { createRow } from '@tanstack/react-table';
import { MRT_ExpandButton } from '../buttons/MRT_ExpandButton';

interface Props<TData extends MRT_RowData> extends TableTrProps {
Expand Down Expand Up @@ -54,12 +60,12 @@ export const MRT_TableBodyEmptyRow = <TData extends MRT_RowData>({

return (
<MRT_TableBodyRow
table={table}
tableProps={tableProps}
className={clsx(
'mrt-table-body-row',
layoutMode?.startsWith('grid') && classes['empty-row-tr-grid'],
)}
table={table}
tableProps={tableProps}
{...emptyRowProps}
>
{renderDetailPanel && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import clsx from 'clsx';

import classes from './MRT_TableBodyRow.module.css';

import { type DragEvent, memo, useMemo, useRef } from 'react';

import {
Box,
type TableProps,
TableTr,
type TableTrProps,
} from '@mantine/core';
import { MRT_TableBodyCell, Memo_MRT_TableBodyCell } from './MRT_TableBodyCell';

import { Memo_MRT_TableBodyCell, MRT_TableBodyCell } from './MRT_TableBodyCell';
import { MRT_TableDetailPanel } from './MRT_TableDetailPanel';

import {
type MRT_Cell,
type MRT_ColumnVirtualizer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type DragEvent, type RefObject } from 'react';

import { type ActionIconProps } from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type ActionIconProps, Box } from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import clsx from 'clsx';

import classes from './MRT_TableDetailPanel.module.css';

import { type RefObject } from 'react';

import { Collapse, TableTd, type TableTdProps, TableTr } from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down Expand Up @@ -66,7 +70,7 @@ export const MRT_TableDetailPanel = <TData extends MRT_RowData>({
));

const DetailPanel =
!isLoading && row.getIsExpanded() && renderDetailPanel?.({ row, table, internalEditComponents });
!isLoading && row.getIsExpanded() && renderDetailPanel?.({ internalEditComponents, row, table });

return (
<TableTr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import clsx from 'clsx';

import classes from './MRT_ColumnPinningButtons.module.css';

import { ActionIcon, Flex, Tooltip } from '@mantine/core';

import {
type MRT_Column,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import clsx from 'clsx';

import classes from './MRT_CopyButton.module.css';

import { type ReactNode } from 'react';

import {
CopyButton,
Tooltip,
UnstyledButton,
type UnstyledButtonProps,
} from '@mantine/core';

import {
type MRT_Cell,
type MRT_CellValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import clsx from 'clsx';

import classes from './MRT_EditActionButtons.module.css';

import { ActionIcon, Box, type BoxProps, Button, Tooltip } from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import clsx from 'clsx';

import classes from './MRT_ExpandAllButton.module.css';

import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import { type MRT_RowData, type MRT_TableInstance } from '../../types';
import { parseFromValuesOrFunc } from '../../utils/utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import clsx from 'clsx';

import classes from './MRT_ExpandButton.module.css';

import { type MouseEvent } from 'react';

import {
ActionIcon,
type ActionIconProps,
Tooltip,
useDirection,
} from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down Expand Up @@ -54,7 +58,7 @@ export const MRT_ExpandButton = <TData extends MRT_RowData>({
const canExpand = row.getCanExpand();
const isExpanded = row.getIsExpanded();

const DetailPanel = !!renderDetailPanel?.({ row, table, internalEditComponents });
const DetailPanel = !!renderDetailPanel?.({ internalEditComponents, row, table });

const handleToggleExpand = (event: MouseEvent<HTMLButtonElement>) => {
event.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import clsx from 'clsx';

import classes from './MRT_GrabHandleButton.module.css';

import { type DragEventHandler } from 'react';

import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_RowData,
Expand Down Expand Up @@ -42,13 +46,13 @@ export const MRT_GrabHandleButton = <TData extends MRT_RowData>({
actionIconProps?.className,
)}
color="gray"
size="sm"
onClick={(e) => {
e.stopPropagation();
actionIconProps?.onClick?.(e);
}}
onDragEnd={onDragEnd}
onDragStart={onDragStart}
size="sm"
title={undefined}
variant="transparent"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type MouseEvent, useState } from 'react';

import { type RowPinningPosition } from '@tanstack/react-table';

import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type MRT_Row,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionIcon, type ActionIconProps, Menu, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_DensityState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useState } from 'react';

import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core';

import {
type HTMLPropsRef,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type MouseEvent } from 'react';

import { ActionIcon, Tooltip } from '@mantine/core';

import { MRT_EditActionButtons } from './MRT_EditActionButtons';

import {
type MRT_Cell,
type MRT_CellValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import clsx from 'clsx';

import classes from './MRT_TableFooter.module.css';

import { TableTfoot, type TableTfootProps } from '@mantine/core';

import { MRT_TableFooterRow } from './MRT_TableFooterRow';

import {
type MRT_ColumnVirtualizer,
type MRT_RowData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import clsx from 'clsx';

import classes from './MRT_TableFooterCell.module.css';

import { type CSSProperties } from 'react';

import { TableTh, type TableThProps, useDirection } from '@mantine/core';

import {
type MRT_Header,
type MRT_RowData,
Expand Down
Loading

0 comments on commit 44fd9c7

Please sign in to comment.