Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint dependencies #3608

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export default [
'react/forbid-elements': 0,
'react/forbid-foreign-prop-types': 0,
'react/forbid-prop-types': 0,
'react/forward-ref-uses-ref': 1,
'react/function-component-definition': [
1,
{
Expand Down Expand Up @@ -439,6 +440,7 @@ export default [
'@typescript-eslint/no-base-to-string': 0,
'@typescript-eslint/no-confusing-non-null-assertion': 0,
'@typescript-eslint/no-confusing-void-expression': [1, { ignoreArrowShorthand: true }],
'@typescript-eslint/no-deprecated': 1,
'@typescript-eslint/no-duplicate-enum-values': 1,
'@typescript-eslint/no-duplicate-type-constituents': 1,
'@typescript-eslint/no-dynamic-delete': 0,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^22.0.0",
"@types/react": "^18.3.3",
"@types/react": "^18.3.9",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@typescript-eslint/parser": "^8.7.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/browser": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/eslint-plugin": "^1.1.4",
"@wyw-in-js/rollup": "^0.5.0",
"@wyw-in-js/vite": "^0.5.0",
"babel-plugin-optimize-clsx": "^2.6.2",
"eslint": "^9.9.0",
"eslint": "^9.11.1",
"eslint-plugin-jest-dom": "^5.0.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-sonarjs": "^2.0.2",
"eslint-plugin-testing-library": "^6.3.0",
Expand Down
1 change: 1 addition & 0 deletions src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ function DataGrid<R, SR, K extends Key>(
const isRowEvent = isTreeGrid && event.target === focusSinkRef.current;
if (!isCellEvent && !isRowEvent) return;

// eslint-disable-next-line @typescript-eslint/no-deprecated
const { keyCode } = event;

if (
Expand Down
7 changes: 6 additions & 1 deletion src/DragHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ const cellDragHandleFrozenClassname = css`

const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;

// TODO: replace with RefObject once we drop support for React 18
nstepien marked this conversation as resolved.
Show resolved Hide resolved
interface LatestDraggedOverRowIdxRef {
readonly current: number | undefined;
}

interface Props<R, SR> extends Pick<DataGridProps<R, SR>, 'rows' | 'onRowsChange'> {
gridRowStart: number;
column: CalculatedColumn<R, SR>;
columnWidth: number | string;
maxColIdx: number;
isLastRow: boolean;
selectedPosition: SelectCellState;
latestDraggedOverRowIdx: React.MutableRefObject<number | undefined>;
latestDraggedOverRowIdx: LatestDraggedOverRowIdxRef;
isCellEditable: (position: Position) => boolean;
onClick: () => void;
onFill: (event: FillEvent<R>) => R;
Expand Down
1 change: 1 addition & 0 deletions src/TreeDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ function TreeDataGrid<R, SR, K extends Key>(
}

// Prevent copy/paste on group rows
// eslint-disable-next-line @typescript-eslint/no-deprecated
if (isCtrlKeyHeldDown(event) && (event.keyCode === 67 || event.keyCode === 86)) {
event.preventGridDefault();
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/keyboardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function isCtrlKeyHeldDown(e: React.KeyboardEvent): boolean {

export function isDefaultCellInput(event: React.KeyboardEvent<HTMLDivElement>): boolean {
const vKey = 86;
// eslint-disable-next-line @typescript-eslint/no-deprecated
if (isCtrlKeyHeldDown(event) && event.keyCode !== vKey) return false;
return !nonInputKeys.has(event.key);
}
Expand Down