Skip to content

Commit

Permalink
Merge pull request #255 from bento-platform/lint/enforce-hook-deps-tsx
Browse files Browse the repository at this point in the history
lint: enforce hook dependencies + CustomEmpty -> tsx
  • Loading branch information
davidlougheed authored Feb 13, 2025
2 parents 28edab0 + 2cd06e0 commit c707c2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
Expand All @@ -40,6 +41,7 @@ module.exports = {
],
semi: ['error', 'always'],
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': ['error'],
},
settings: {
react: {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Beacon/BeaconCommon/BeaconQueryFormUi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const BeaconQueryFormUi = ({
}
return payload;
},
[scope]
[scope, isNetworkQuery]
);

const launchEmptyQuery = useCallback(
Expand All @@ -107,7 +107,7 @@ const BeaconQueryFormUi = ({

// set assembly id options matching what's in gohan (for local beacon) or in network
form.setFieldsValue(formInitialValues);
}, [beaconAssemblyIds.length, form, formInitialValues, isAuthenticated, isNetworkQuery, launchEmptyQuery]);
}, [scopeSet, beaconAssemblyIds.length, form, formInitialValues, isAuthenticated, isNetworkQuery, launchEmptyQuery]);

// Disables max query param if user is authenticated and authorized
useQueryWithAuthIfAllowed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Empty } from 'antd';
import { useTranslationFn } from '@/hooks';

const CustomEmpty = ({ text }) => {
const CustomEmpty = ({ text }: { text: string }) => {
const t = useTranslationFn();

return <Empty description={t(text)} />;
Expand Down

0 comments on commit c707c2f

Please sign in to comment.