-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Chore: Update eslint-config-expensify to 2.0.49 #42650
Chore: Update eslint-config-expensify to 2.0.49 #42650
Conversation
Thanks! lets get through the failing linter cases tomorrow |
@kacper-mikolajczak Here's a diff to fix the TS errors diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts
index 0ff60458bd..6521497eae 100644
--- a/src/libs/actions/Policy.ts
+++ b/src/libs/actions/Policy.ts
@@ -2115,7 +2115,7 @@ function createDraftInitialWorkspace(policyOwnerEmail = '', policyName = '', pol
}
function buildOptimisticPolicyCategories(policyID: string, categories: readonly string[]) {
- const optimisticCategoryMap = categories.reduce((acc, category) => {
+ const optimisticCategoryMap = categories.reduce<Record<string, Partial<PolicyCategory>>>((acc, category) => {
acc[category] = {
name: category,
enabled: true,
@@ -2125,7 +2125,7 @@ function buildOptimisticPolicyCategories(policyID: string, categories: readonly
return acc;
}, {});
- const successCategoryMap = categories.reduce((acc, category) => {
+ const successCategoryMap = categories.reduce<Record<string, Partial<PolicyCategory>>>((acc, category) => {
acc[category] = {
errors: null,
pendingAction: null,
@@ -2133,7 +2133,7 @@ function buildOptimisticPolicyCategories(policyID: string, categories: readonly
return acc;
}, {});
- const failureCategoryMap = categories.reduce((acc, category) => {
+ const failureCategoryMap = categories.reduce<Record<string, Partial<PolicyCategory>>>((acc, category) => {
acc[category] = {
errors: ErrorUtils.getMicroSecondOnyxError('workspace.categories.createFailureMessage'),
pendingAction: null,
@@ -2510,7 +2510,7 @@ function createDraftWorkspace(policyOwnerEmail = '', makeMeAdmin = false, policy
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyID}`,
- value: CONST.POLICY.DEFAULT_CATEGORIES.reduce((acc, category) => {
+ value: CONST.POLICY.DEFAULT_CATEGORIES.reduce<Record<string, PolicyCategory>>((acc, category) => {
acc[category] = {
name: category,
enabled: true,
diff --git a/src/pages/ReimbursementAccount/utils/getSubstepValues.ts b/src/pages/ReimbursementAccount/utils/getSubstepValues.ts
index 442e7d72bd..f89625c613 100644
--- a/src/pages/ReimbursementAccount/utils/getSubstepValues.ts
+++ b/src/pages/ReimbursementAccount/utils/getSubstepValues.ts
@@ -3,15 +3,19 @@ import type {ReimbursementAccountForm} from '@src/types/form';
import type {ReimbursementAccount} from '@src/types/onyx';
import type {ACHData} from '@src/types/onyx/ReimbursementAccount';
-function getSubstepValues<T extends keyof ReimbursementAccountForm>(
- inputKeys: Record<string, T>,
+type SubstepValues<TProps extends keyof ReimbursementAccountForm> = {
+ [TKey in TProps]: ReimbursementAccountForm[TKey];
+};
+
+function getSubstepValues<TProps extends keyof ReimbursementAccountForm>(
+ inputKeys: Record<string, TProps>,
reimbursementAccountDraft: OnyxEntry<ReimbursementAccountForm>,
reimbursementAccount: OnyxEntry<ReimbursementAccount>,
-): {[K in T]: ReimbursementAccountForm[K]} {
+): SubstepValues<TProps> {
return Object.entries(inputKeys).reduce((acc, [, value]) => {
- acc[value] = reimbursementAccountDraft?.[value] ?? reimbursementAccount?.achData?.[value as keyof ACHData] ?? '';
+ acc[value] = (reimbursementAccountDraft?.[value] ?? reimbursementAccount?.achData?.[value as keyof ACHData] ?? '') as ReimbursementAccountForm[TProps];
return acc;
- }, {} as {[K in T]: ReimbursementAccountForm[K]});
+ }, {} as SubstepValues<TProps>);
}
export default getSubstepValues;
diff --git a/src/types/onyx/PolicyCategory.ts b/src/types/onyx/PolicyCategory.ts
index d65d507656..d4162bfdcd 100644
--- a/src/types/onyx/PolicyCategory.ts
+++ b/src/types/onyx/PolicyCategory.ts
@@ -5,23 +5,23 @@ type PolicyCategory = OnyxCommon.OnyxValueWithOfflineFeedback<{
name: string;
/** Unencoded name of a category */
- unencodedName: string;
+ unencodedName?: string;
/** Flag that determines if a category is active and able to be selected */
enabled: boolean;
/** If true, not adding a comment to a transaction with this category will trigger a violation */
- areCommentsRequired: boolean;
+ areCommentsRequired?: boolean;
/** "General Ledger code" that corresponds to this category in an accounting system. Similar to an ID. */
// eslint-disable-next-line @typescript-eslint/naming-convention
'GL Code'?: string;
/** An ID for this category from an external accounting system */
- externalID: string;
+ externalID?: string;
/** The external accounting service that this category comes from */
- origin: string;
+ origin?: string;
/** The old category name of the category when we edit the category name */
previousCategoryName?: string;
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@mountiny PR is ready for review 👍 |
@DylanDylann lets get this reviewed |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@mountiny I think we need to add label [No QA] in the title for this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything look good
Thanks for review @DylanDylann! @mountiny before we merge this one, I am going to check the results of reassure tests because they seem off a bit. |
Thanks, let us know how the analysis will go, they seem to show a bit of a slow down |
@mountiny if it is possible, could you please share results from reassure dashboard view? I wonder how tests fluctuate between different commits. Thanks! I've checked different PRs (1 & 2) and the results there seem to be quite different every time. Also, when re-running the tests in this PR the outcome is different from the initial run. Throughout the time, do you know how stable the measurments were? If the tests are not reliable then it's quite hard to base anything on them. After re-running the tests I'd say PR is ready for the next step, but I am still interested in what's up with reassure tests. Thanks! |
This is how it looks like @kacper-mikolajczak I think there are some fluctuations, I have noticed that the PR number graph is not correct, there is one jump I can see now in the list at 17:40 but the PR number in the graph is not the actual PR number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move this ahead, but we still have work to be done with the reassure to be of a better use for us I think
Watch out for any regressions
thank you!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
Details
Introduces new custom eslint rule Expensify/eslint-config-expensify#97
Fixed Issues
$ #42414
PROPOSAL: https://callstack-hq.slack.com/archives/C05LX9D6E07/p1715847620457489
Tests
Considering nature of this PR, I would not rely on any specific manual test suite.
Offline tests
QA Steps
Considering nature of this PR, I would not rely on any specific manual test suite.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4