Skip to content

Commit 9f342cf

Browse files
committed
fix: Restore missing hook lint rules
1 parent 3245fd4 commit 9f342cf

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

packages/app/eslint.config.mjs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,23 @@ export default [
122122
...nextPlugin.configs.recommended.rules,
123123
...nextPlugin.configs['core-web-vitals'].rules,
124124
...reactHooksPlugin.configs.recommended.rules,
125-
...eslintReactPlugin.configs.recommended.rules,
126-
// Disable rules from eslint-plugin-react-hooks that have equivalent rules in @eslint-react
127-
...eslintReactPlugin.configs['disable-conflict-eslint-plugin-react-hooks'].rules,
128125
...eslintReactPlugin.configs['recommended-type-checked'].rules,
129-
'react-hooks/set-state-in-effect': 'warn',
130-
'react-hooks/exhaustive-deps': 'error',
126+
'@eslint-react/exhaustive-deps': 'error',
127+
128+
// @eslint-react version is experimental, we'll use react-hooks/set-state-in-render instead
129+
'@eslint-react/set-state-in-render': 'off',
130+
'react-hooks/set-state-in-render': 'error',
131+
132+
// Disable rules from eslint-plugin-react-hooks that have equivalent rules enabled in @eslint-react
133+
'react-hooks/rules-of-hooks': 'off',
134+
'react-hooks/static-components': 'off',
135+
'react-hooks/use-memo': 'off',
136+
'react-hooks/component-hook-factories': 'off',
137+
'react-hooks/error-boundaries': 'off',
138+
'react-hooks/set-state-in-effect': 'off',
139+
'react-hooks/unsupported-syntax': 'off',
140+
'react-hooks/exhaustive-deps': 'off',
141+
131142
'react-hook-form/no-use-watch': 'error',
132143
'@eslint-react/no-unstable-default-props': 'error',
133144
'@typescript-eslint/ban-ts-comment': 'warn',

packages/app/src/DBSearchPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ function DBSearchPage() {
12301230
updateRelativeTimeInputValue(interval);
12311231
}
12321232
// we only want this to run on initial mount
1233-
// eslint-disable-next-line react-hooks/exhaustive-deps
1233+
// eslint-disable-next-line @eslint-react/exhaustive-deps
12341234
}, [updateRelativeTimeInputValue, searchedConfig.source, isReady]);
12351235

12361236
useLiveUpdate({

packages/app/src/components/DBRowTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export const RawLogTable = memo(
858858
// Conditions not met, clear flag
859859
tableSearch.clearShouldScrollToMatch();
860860
}
861-
// eslint-disable-next-line react-hooks/exhaustive-deps
861+
// eslint-disable-next-line @eslint-react/exhaustive-deps
862862
}, [
863863
tableSearch.shouldScrollToMatch,
864864
tableSearch.currentMatchIndex,
@@ -1531,7 +1531,7 @@ function DBSqlRowTableComponent({
15311531
if (prevSourceId && prevSourceId !== sourceId) {
15321532
_onSortingChange(null);
15331533
}
1534-
// eslint-disable-next-line react-hooks/exhaustive-deps
1534+
// eslint-disable-next-line @eslint-react/exhaustive-deps
15351535
}, [sourceId]);
15361536

15371537
// Sync local orderBy state with initialSortBy when it changes

packages/app/src/components/DBTable/TableSearchInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const TableSearchInput = ({
141141

142142
// Handle keyboard shortcuts (Cmd+F, Escape)
143143
const handleKeyDown = useCallback(
144+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
144145
(e: KeyboardEvent) => {
145146
// Detect Cmd+F (Mac) or Ctrl+F (Windows/Linux)
146147
if ((e.metaKey || e.ctrlKey) && e.key === 'f') {
@@ -155,7 +156,7 @@ export const TableSearchInput = ({
155156
handleClose();
156157
}
157158
},
158-
// eslint-disable-next-line react-hooks/exhaustive-deps
159+
// eslint-disable-next-line @eslint-react/exhaustive-deps
159160
[isVisible, handleClose, handleShow],
160161
);
161162

packages/app/src/components/TimePicker/TimePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const TimePickerComponent = ({
135135
}
136136
}
137137
// only run when dateRange changes or opened state changes
138-
// eslint-disable-next-line react-hooks/exhaustive-deps
138+
// eslint-disable-next-line @eslint-react/exhaustive-deps
139139
}, [dateRange, opened, mode]);
140140

141141
const handleRelativeSearch = React.useCallback(

packages/app/src/hooks/useTableSearch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function useTableSearch({
9797
shouldScrollToMatchRef.current = true;
9898
}
9999
// Otherwise keep the current match index as is (loading more data shouldn't change position)
100-
// eslint-disable-next-line react-hooks/exhaustive-deps
100+
// eslint-disable-next-line @eslint-react/exhaustive-deps
101101
}, [debouncedSearchQuery, rows, searchableColumns]);
102102

103103
// Handle visibility changes
@@ -146,6 +146,7 @@ export function useTableSearch({
146146
shouldScrollToMatchRef.current = false;
147147
}, []);
148148

149+
// eslint-disable-next-line react-hooks/refs
149150
return {
150151
searchQuery: debouncedSearchQuery,
151152
inputValue,
@@ -154,6 +155,7 @@ export function useTableSearch({
154155
currentMatchIndex,
155156
isSearchVisible,
156157
setIsSearchVisible,
158+
// eslint-disable-next-line react-hooks/refs
157159
shouldScrollToMatch: shouldScrollToMatchRef.current,
158160
clearShouldScrollToMatch,
159161
handlePreviousMatch,

packages/app/src/searchFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ export const useSearchPageFilterState = ({
420420
setFilters(parsedQuery.filters);
421421
}
422422
// only react to changes in parsed query
423-
// eslint-disable-next-line react-hooks/exhaustive-deps
423+
// eslint-disable-next-line @eslint-react/exhaustive-deps
424424
}, [parsedQuery.filters]);
425425

426426
const updateFilterQuery = React.useCallback(

0 commit comments

Comments
 (0)