Skip to content

Commit fcabc6d

Browse files
authored
Merge pull request Expensify#76019 from callstack-internal/chore/eslint-config-expensify-2.0.100
[NoQA] Chore: Bump eslint-config-expensify to 2.0.100
2 parents 963b4e9 + 24d28d6 commit fcabc6d

130 files changed

Lines changed: 311 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/code-inline-reviewer.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -198,39 +198,6 @@ memo(ReportActionItem, (prevProps, nextProps) =>
198198
)
199199
```
200200

201-
---
202-
203-
### [PERF-6] Use specific properties as hook dependencies
204-
205-
- **Search patterns**: `useEffect`, `useMemo`, `useCallback` dependency arrays
206-
207-
- **Condition**: In `useEffect`, `useMemo`, and `useCallback`, specify individual object properties as dependencies instead of passing entire objects.
208-
- **Reasoning**: Passing entire objects as dependencies causes hooks to re-execute whenever any property changes, even unrelated ones. Specifying individual properties creates more granular dependency tracking, reducing unnecessary hook executions and improving performance predictability.
209-
210-
Good:
211-
212-
```tsx
213-
const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => {
214-
return {
215-
amountColumnSize: transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
216-
taxAmountColumnSize: transactionItem.isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
217-
dateColumnSize: transactionItem.shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
218-
};
219-
}, [transactionItem.isAmountColumnWide, transactionItem.isTaxAmountColumnWide, transactionItem.shouldShowYear]);
220-
```
221-
222-
Bad:
223-
224-
```tsx
225-
const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => {
226-
return {
227-
amountColumnSize: transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
228-
taxAmountColumnSize: transactionItem.isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
229-
dateColumnSize: transactionItem.shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
230-
};
231-
}, [transactionItem]);
232-
```
233-
234201
## Instructions
235202

236203
1. **First, get the list of changed files and their diffs:**

eslint.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ const config = defineConfig([
272272
'rulesdir/prefer-underscore-method': 'off',
273273
'rulesdir/prefer-import-module-contents': 'off',
274274
'rulesdir/no-beta-handler': 'error',
275+
'rulesdir/prefer-narrow-hook-dependencies': [
276+
'error',
277+
{
278+
stableObjectPatterns: [
279+
// cSpell:ignore tyles
280+
'[Ss]tyles?$', // Excludes 'style', 'styles', 'themeStyles', etc.
281+
'^theme', // Excludes 'theme', 'themeStyles', 'themeIllustrations', etc.
282+
'[Ii]cons?$', // Excludes 'icon', 'icons', 'expensifyIcons', etc.
283+
],
284+
},
285+
],
275286

276287
// React and React Native specific rules
277288
'react-native-a11y/has-accessibility-hint': ['off'],

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
"electron-builder": "26.0.19",
312312
"eslint": "^9.36.0",
313313
"eslint-config-airbnb-typescript": "^18.0.0",
314-
"eslint-config-expensify": "2.0.99",
314+
"eslint-config-expensify": "2.0.100",
315315
"eslint-config-prettier": "^9.1.0",
316316
"eslint-plugin-jest": "^29.0.1",
317317
"eslint-plugin-jsdoc": "^60.7.0",

src/Expensify.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function Expensify() {
133133
}, [isCheckingPublicRoom]);
134134

135135
const isAuthenticated = useIsAuthenticated();
136-
const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]);
136+
const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session?.autoAuthState]);
137137

138138
const isSplashReadyToBeHidden = splashScreenState === CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN;
139139
const isSplashVisible = splashScreenState === CONST.BOOT_SPLASH_STATE.VISIBLE;

src/components/AddPlaidBankAccount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function AddPlaidBankAccount({
103103
*/
104104
const isAuthenticatedWithPlaid = useCallback(
105105
() => (!!receivedRedirectURI && !!plaidLinkOAuthToken) || !!plaidData?.bankAccounts?.length || !isEmptyObject(plaidData?.errors),
106-
[plaidData, plaidLinkOAuthToken, receivedRedirectURI],
106+
[plaidData?.bankAccounts?.length, plaidData?.errors, plaidLinkOAuthToken, receivedRedirectURI],
107107
);
108108

109109
/**

src/components/ApproverSelectionList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function ApproverSelectionList({
138138
contentFitImage="contain"
139139
/>
140140
),
141-
[translate, listEmptyContentSubtitle, styles.textSupporting, styles.pb10, lazyIllustrations],
141+
[translate, listEmptyContentSubtitle, styles.textSupporting, styles.pb10, lazyIllustrations.TurtleInShell],
142142
);
143143

144144
return (

src/components/AvatarWithDisplayName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function AvatarWithDisplayName({
207207
}
208208
const parentReportAction = parentReportActions?.[report?.parentReportActionID];
209209
actorAccountID.current = parentReportAction?.actorAccountID ?? CONST.DEFAULT_NUMBER_ID;
210-
}, [parentReportActions, report]);
210+
}, [parentReportActions, report?.parentReportActionID]);
211211

212212
const goToDetailsPage = useCallback(() => {
213213
navigateToDetailsPage(report, Navigation.getActiveRoute());

src/components/BlockingViews/ForceFullScreenView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function ForceFullScreenView({children, shouldForceFullScreen = false}: ForceFul
1818
addRouteKey(route.key);
1919

2020
return () => removeRouteKey(route.key);
21-
}, [addRouteKey, removeRouteKey, route, shouldForceFullScreen]);
21+
}, [addRouteKey, removeRouteKey, route.key, shouldForceFullScreen]);
2222

2323
if (shouldForceFullScreen) {
2424
return <View style={styles.forcedBlockingViewContainer}>{children}</View>;

src/components/DatePicker/CalendarPicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function CalendarPicker({
165165
const newHeight = rowCount * CONST.CALENDAR_PICKER_DAY_HEIGHT;
166166

167167
heightValue.set(withTiming(newHeight, {duration: 50}));
168-
}, [calendarDaysMatrix, heightValue, isSmallScreenWidth]);
168+
}, [calendarDaysMatrix?.length, heightValue, isSmallScreenWidth]);
169169

170170
const animatedStyle = useAnimatedStyle(() => {
171171
return {

0 commit comments

Comments
 (0)