-
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
Bump ESLint version to add prefer-at condition #47439
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
cadeafa
to
380f4c7
Compare
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.
Did a partial review since there are actually hundreds of TS errors with the change to .at()
@ShridharGoel Whats the status of this PR? I think you can work on fixing the TS errors that are not related to this PR while we wait for that one. Please let's speed up the work here.
@@ -50,7 +50,7 @@ function ButtonWithDropdownMenu<IValueType>({ | |||
const {windowWidth, windowHeight} = useWindowDimensions(); | |||
const dropdownAnchor = useRef<View | null>(null); | |||
const dropdownButtonRef = isSplitButton ? buttonRef : mergeRefs(buttonRef, dropdownAnchor); | |||
const selectedItem = options[selectedItemIndex] || options[0]; | |||
const selectedItem = options.at(selectedItemIndex) ?? options.at(0); |
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.
Let's test this operator change to make sure there's no regression
@@ -51,8 +51,8 @@ export default function generateMonthMatrix(year: number, month: number) { | |||
} | |||
|
|||
// Add null values for days before the first day of the month | |||
for (let i = matrix[0].length; i < 7; i++) { | |||
matrix[0].unshift(undefined); | |||
for (let i = matrix.at(0).length; i < 7; i++) { |
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.
We need some condition before because matrix.at(0)
can be undefined
now
src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx
Outdated
Show resolved
Hide resolved
This just needed an update of the eslint-config-expensify version after Expensify/eslint-config-expensify#114 gets merged. But now we'll need to fix the conflicts as well, and I'll add the suggested changes. |
@ShridharGoel The ESLint PR was merged, could you prioritize work on this one? Thanks 🙏 |
3ce0318
to
9eea593
Compare
a4f97fb
to
9aaf7c0
Compare
Just need to check the test failure now. |
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.
@ShridharGoel Thanks for the work on this. Some notes though:
- Please run
npm run gh-actions-build
every time you change any files under.github/actions/javascript/
as we need to re-generate the compiled JS files. - I'm seeing many ESLint suppresions, mainly
eslint-disable rulesdir/prefer-at
which defeats the purpose of this PR. Let's address and remove all them as much as possible. - Let's remove
[NoQA]
from this PR's title as I think we should have extensive testing here due to changes in logic. @roryabraham WDYT about asking for a full regression test here? - Once you solve the lint / workflow errors I think we can open the PR to review.
const mostRecentChecklist = recentDeployChecklists.at(0); | ||
|
||
if (!mostRecentChecklist) { | ||
return; |
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.
return; | |
throw new Error('Could not find the most recent checklist'); |
Shouldn't we try an Error here instead?
if (shouldCreateNewDeployChecklist) { | ||
console.log('Latest StagingDeployCash is closed, creating a new one.', mostRecentChecklist); | ||
} else { | ||
console.log('Latest StagingDeployCash is open, updating it instead of creating a new one.', 'Current:', mostRecentChecklist, 'Previous:', previousChecklist); | ||
} | ||
|
||
if (!previousChecklist) { | ||
return; |
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.
return; | |
throw new Error('Could not find the previous checklist'); |
@@ -78,7 +78,7 @@ async function run() { | |||
labels: CONST.LABELS.STAGING_DEPLOY, | |||
state: 'closed', | |||
}); | |||
const previousChecklistID = deployChecklists[0].number; | |||
const previousChecklistID = deployChecklists.at(0)?.number ?? 0; |
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.
const previousChecklistID = deployChecklists.at(0)?.number ?? 0; | |
const previousChecklistID = deployChecklists.at(0)?.number; | |
if (!previousChecklistID) { | |
throw new Error('Could not find the previous checklist ID'); | |
} |
.github/scripts/createDocsRoutes.ts
Outdated
const frontmatter = fs.readFileSync(path, 'utf8').split('---').at(1); | ||
const frontmatterObject = yaml.load(frontmatter ?? '') as Record<string, unknown>; |
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.
const frontmatter = fs.readFileSync(path, 'utf8').split('---').at(1); | |
const frontmatterObject = yaml.load(frontmatter ?? '') as Record<string, unknown>; | |
const frontmatter = fs.readFileSync(path, 'utf8').split('---').at(1); | |
if (!frontmatter) { | |
return; | |
} | |
const frontmatterObject = yaml.load(frontmatter) as Record<string, unknown>; |
I think it's safer
if (item) { | ||
setActiveSource(item.source); | ||
} | ||
|
||
if (onNavigate) { | ||
if (onNavigate && item) { | ||
onNavigate(item); | ||
} |
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.
if (item) { | |
setActiveSource(item.source); | |
} | |
if (onNavigate) { | |
if (onNavigate && item) { | |
onNavigate(item); | |
} | |
if (item) { | |
setActiveSource(item.source); | |
if (onNavigate) { | |
onNavigate(item); | |
} | |
} |
@@ -1,4 +1,6 @@ | |||
/* eslint-disable @typescript-eslint/naming-convention */ | |||
|
|||
/* eslint-disable rulesdir/prefer-at */ |
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.
Why?
tests/e2e/measure/math.ts
Outdated
@@ -1,3 +1,4 @@ | |||
/* eslint-disable rulesdir/prefer-at */ |
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.
Why?
@@ -1,3 +1,4 @@ | |||
/* eslint-disable rulesdir/prefer-at */ |
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.
Why?
@@ -1,3 +1,4 @@ | |||
/* eslint-disable rulesdir/prefer-at */ |
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.
Why?
@@ -1,4 +1,5 @@ | |||
/* eslint-disable @typescript-eslint/naming-convention */ | |||
/* eslint-disable rulesdir/prefer-at */ |
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.
Why?
We can do that, but let's do it on one platform only to save time and money |
I've fixed most of the comments locally. Will be updating once all things
look good to me.
|
Updated. |
@ShridharGoel We got conflicts in the PR. Please address them together with the workflow failures (except |
What about the react compiler issues? There seem to be many of them, are
all of them due to the new changes?
|
@ShridharGoel By looking at the workflow result, it seems to be only these ones:
|
In ReportTypingIndicator, my only change is a single [] to at(). Any idea how can it lead to invalid nesting which is mentioned in logs generated locally? |
@ShridharGoel There is a section about your error ( |
Yes, I had checked that yesterday and made updated in two files but still
that doesn't seem to fix the issues. Well check again, any way to know the
exact lines which are causing the issue?
|
All perf tests are passing locally, so is this a CI issue? |
Can we go ahead with the review on this? |
@ShridharGoel This issue has been reassigned, please check this #43055 (comment). So, I think this PR will be on hold. |
Ok, but since the work here is done - so shouldn't we prevent rework and
continue with this PR itself?
|
CC: @roryabraham |
Details
Bump ESLint version to add prefer-at condition.
Fixed Issues
$ #43055
PROPOSAL: #43055 (comment)
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop