Skip to content

Commit 63df756

Browse files
Revert max-warnings change and add explanatory comments to eslint-disable directives
Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
1 parent 4e39d38 commit 63df756

5 files changed

Lines changed: 11 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4646
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
4747
"typecheck-tsgo": "tsgo --project tsconfig.tsgo.json",
48-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=331 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
48+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=334 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
4949
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5050
"check-lazy-loading": "ts-node scripts/checkLazyLoading.ts",
5151
"lint-watch": "npx eslint-watch --watch --changed",

src/pages/workspace/travel/WorkspaceTravelInvoicingExportPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ function WorkspaceTravelInvoicingExportPage({route}: WorkspaceTravelInvoicingExp
181181
setIsDownloading(false),
182182
);
183183
} else {
184+
// Intentional: this setState resets the loading indicator when generation completes but no file is available.
185+
// It runs in a cleanup path of the effect, not as a cascading re-render trigger.
184186
// eslint-disable-next-line react-hooks/set-state-in-effect
185187
setIsDownloading(false);
186188
}

src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ function WorkspaceUpgradePage({route}: WorkspaceUpgradePageProps) {
8787

8888
const defaultApprover = getDefaultApprover(policy);
8989

90+
// useCallback is needed here because goBack is passed as a prop to child components;
91+
// the rule flags it because the deps could be inlined, but removing useCallback would cause unnecessary re-renders.
9092
// eslint-disable-next-line react-hooks/preserve-manual-memoization
9193
const goBack = useCallback(() => {
9294
if ((!feature && featureNameAlias !== CONST.UPGRADE_FEATURE_INTRO_MAPPING.policyPreventMemberChangingTitle.alias) || !policyID) {
@@ -132,6 +134,8 @@ function WorkspaceUpgradePage({route}: WorkspaceUpgradePageProps) {
132134
upgradeToCorporate(policy.id, feature?.name);
133135
};
134136

137+
// useCallback is needed here because confirmUpgrade is passed as a prop to child components;
138+
// the rule flags it because the deps could be inlined, but removing useCallback would cause unnecessary re-renders.
135139
// eslint-disable-next-line react-hooks/preserve-manual-memoization
136140
const confirmUpgrade = useCallback(() => {
137141
if (!policyID) {

src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true
123123
errors: null,
124124
originalApprovers: currentApprovalWorkflow.approvers,
125125
});
126+
// Intentional: synchronizes the initial workflow snapshot when the current workflow changes.
127+
// This runs alongside setApprovalWorkflow above and is part of the same logical update.
126128
// eslint-disable-next-line react-hooks/set-state-in-effect
127129
setInitialApprovalWorkflow(currentApprovalWorkflow);
128130
}, [currentApprovalWorkflow, defaultWorkflowMembers, initialApprovalWorkflow, usedApproverEmails]);

src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ function WorkspaceWorkflowsApprovalsExpensesFromPage({policy, isLoadingReportDat
4848
return;
4949
}
5050

51+
// Intentional: derives the selected-members list from the approval workflow data.
52+
// This effect synchronizes local component state with the Onyx-sourced workflow when it changes.
5153
// eslint-disable-next-line react-hooks/set-state-in-effect
5254
setSelectedMembers(
5355
approvalWorkflow.members.map((member) => {

0 commit comments

Comments
 (0)