Skip to content

Commit 793929e

Browse files
authored
Update typescript-eslint config (#3977)
* Update typescript-eslint config * update * fix
1 parent 536fe13 commit 793929e

16 files changed

Lines changed: 166 additions & 112 deletions

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ updates:
1111
patterns:
1212
- 'react'
1313
- 'react-dom'
14-
typescript-eslint:
15-
patterns:
16-
- '@typescript-eslint/*'
1714
vitest:
1815
patterns:
1916
- 'vitest'

eslint.config.js

Lines changed: 156 additions & 81 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
"@types/node": "^25.0.2",
5656
"@types/react": "^19.2.0",
5757
"@types/react-dom": "^19.2.0",
58-
"@typescript-eslint/eslint-plugin": "^8.48.1",
59-
"@typescript-eslint/parser": "^8.48.1",
6058
"@vitejs/plugin-react": "^5.1.1",
6159
"@vitest/browser-playwright": "^4.0.16",
6260
"@vitest/coverage-istanbul": "^4.0.16",
@@ -78,6 +76,7 @@
7876
"rolldown": "^1.0.0-rc.3",
7977
"rolldown-plugin-dts": "^0.22.1",
8078
"typescript": "~5.9.2",
79+
"typescript-eslint": "^8.56.0",
8180
"vite": "^8.0.0-beta.13",
8281
"vitest": "^4.0.17",
8382
"vitest-browser-react": "^2.0.2"

src/TreeDataGrid.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ export function TreeDataGrid<R, SR = unknown, K extends Key = Key>({
139139
}, [groupBy, rowGrouper, rawRows]);
140140

141141
const [rows, isGroupRow] = useMemo((): [
142-
ReadonlyArray<R | GroupRow<R>>,
142+
readonly (R | GroupRow<R>)[],
143143
(row: R | GroupRow<R>) => row is GroupRow<R>
144144
] => {
145145
const allGroupRows = new Set<unknown>();
146146
if (!groupedRows) return [rawRows, isGroupRow];
147147

148-
const flattenedRows: Array<R | GroupRow<R>> = [];
148+
const flattenedRows: (R | GroupRow<R>)[] = [];
149149

150150
const expandGroup = (
151151
rows: GroupByDictionary<R> | readonly R[],
@@ -298,7 +298,6 @@ export function TreeDataGrid<R, SR = unknown, K extends Key = Key>({
298298

299299
if (args.mode === 'EDIT') return;
300300
const { column, rowIdx, selectCell } = args;
301-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
302301
const idx = column?.idx ?? -1;
303302
const row = rows[rowIdx];
304303

src/hooks/useCalculatedColumns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { DataGridProps } from '../DataGrid';
88
import renderHeaderCell from '../renderHeaderCell';
99

1010
type Mutable<T> = {
11-
-readonly [P in keyof T]: T[P] extends ReadonlyArray<infer V> ? Mutable<V>[] : T[P];
11+
-readonly [P in keyof T]: T[P] extends readonly (infer V)[] ? Mutable<V>[] : T[P];
1212
};
1313

1414
interface WithParent<R, SR> {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export interface CellMouseArgs<TRow, TSummaryRow = unknown> {
203203

204204
interface SelectCellKeyDownArgs<TRow, TSummaryRow = unknown> {
205205
mode: 'SELECT';
206-
column: CalculatedColumn<TRow, TSummaryRow>;
206+
column: CalculatedColumn<TRow, TSummaryRow> | undefined;
207207
row: TRow;
208208
rowIdx: number;
209209
selectCell: (position: Position, options?: SelectCellOptions) => void;

test/browser/TreeDataGrid.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ function TestGrid({
124124

125125
function rowGrouper(rows: readonly Row[], columnKey: string) {
126126
// @ts-expect-error
127-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
128127
return Object.groupBy(rows, (r) => r[columnKey]) as Record<string, readonly R[]>;
129128
}
130129

test/browser/column/renderHeaderCell.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('renderHeaderCell is either undefined or a component', async () => {
1414
{
1515
key: 'name',
1616
name: 'Name',
17-
renderHeaderCell: ({ column }) => `Fancy! ${column.name}`
17+
renderHeaderCell: ({ column }) => `Fancy! ${column.name as string}`
1818
}
1919
];
2020

test/visual/treeGrid.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,5 @@ function rowKeyGetter(row: Row) {
8585

8686
function rowGrouper(rows: readonly Row[], columnKey: string) {
8787
// @ts-expect-error
88-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
8988
return Object.groupBy(rows, (r) => r[columnKey]) as Record<string, readonly R[]>;
9089
}

website/Nav.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Link } from '@tanstack/react-router';
33
import { css } from 'ecij';
44

55
import type { Direction } from '../src/types';
6-
import { startViewTransition } from './utils';
76

87
const headerClassname = css`
98
border-inline-start: 4px solid light-dark(hsl(210deg 50% 80%), hsl(210deg 50% 40%));
@@ -64,7 +63,7 @@ export default function Nav({ direction, onDirectionChange }: Props) {
6463
const [theme, setTheme] = useState<Theme>('system');
6564

6665
function onThemeChange(theme: Theme) {
67-
startViewTransition(() => {
66+
document.startViewTransition(() => {
6867
setTheme(theme);
6968
});
7069
}

0 commit comments

Comments
 (0)