-
Notifications
You must be signed in to change notification settings - Fork 26
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
build: Apply recommended lint rules #3524
base: main
Are you sure you want to change the base?
Conversation
Bundle ReportChanges will decrease total bundle size by 859 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## gh-eng-2124-audit-and-update-lint-rules-for-gazebo #3524 +/- ##
===================================================================================
Coverage 98.92% 98.93%
===================================================================================
Files 806 806
Lines 14372 14372
Branches 4079 4083 +4
===================================================================================
+ Hits 14218 14219 +1
+ Misses 147 146 -1
Partials 7 7
... and 8 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3524 +/- ##
=======================================
Coverage 98.93% 98.93%
=======================================
Files 806 806
Lines 14369 14372 +3
Branches 4077 4083 +6
=======================================
+ Hits 14216 14219 +3
Misses 146 146
Partials 7 7
... and 15 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
🚨 Try these New Features:
|
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
Bundle ReportChanges will decrease total bundle size by 859 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## gh-eng-2124-audit-and-update-lint-rules-for-gazebo #3524 +/- ##
===================================================================================
Coverage 98.92% 98.93%
===================================================================================
Files 806 806
Lines 14372 14372
Branches 4086 4083 -3
===================================================================================
+ Hits 14218 14219 +1
+ Misses 147 146 -1
Partials 7 7
... and 8 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
@@ -31,7 +31,7 @@ const queryClient = new QueryClient({ | |||
}) | |||
const server = setupServer() | |||
|
|||
let testLocation: { pathname: string; search: string } = { | |||
const testLocation: { pathname: string; search: string } = { |
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.
Auto fix as this wasn't being reassigned
@@ -82,7 +82,7 @@ describe('MyContextSwitcher', () => { | |||
return HttpResponse.json({ data: { me: null } }) | |||
} | |||
|
|||
const orgList = !!info.variables?.after ? org2 : org1 | |||
const orgList = info.variables?.after ? org2 : org1 |
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.
Linter autofix
@@ -79,7 +79,7 @@ describe('useOktaConfig', () => { | |||
}) | |||
|
|||
describe('invalid schema', () => { | |||
let consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) | |||
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) |
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.
Linter autofix - wasn't being reassigned
return HttpResponse.json({ data: response }) | ||
}) | ||
) | ||
} | ||
|
||
describe('when calling the mutation', () => { | ||
let consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) | ||
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) |
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.
Linter autofix - wasn't being reassigned
@@ -71,7 +71,7 @@ interface CreateTableArgs { | |||
const createTable = ({ tableData, seatData, mutate }: CreateTableArgs) => { | |||
return tableData?.map( | |||
({ ownerid, activated, email, isAdmin, name, username }) => { | |||
let maxSeats = seatData?.seatsUsed === seatData?.seatsLimit | |||
const maxSeats = seatData?.seatsUsed === seatData?.seatsLimit |
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.
Linter autofix - wasn't being reassigned
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.
Remove unused setup functions
@@ -206,7 +206,7 @@ const Select = forwardRef( | |||
{ | |||
'border overflow-y-auto': isOpen, | |||
}, | |||
!!onSearch ? 'top-16' : 'top-8 rounded' | |||
onSearch ? 'top-16' : 'top-8 rounded' |
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.
Linter autofix - removing double !!
const toggleItem = (selectedItem) => { | ||
isItemSelected(selectedItem, selectedItems) | ||
? removeSelectedItem(selectedItem) | ||
: addSelectedItem(selectedItem) | ||
if (isItemSelected(selectedItem, selectedItems)) { | ||
removeSelectedItem(selectedItem) | ||
} else { | ||
addSelectedItem(selectedItem) | ||
} |
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.
TS lint rules don't like ternaries being used unless a value is being set/returned so this is the way around that
if (isAllButton(selectedItem)) { | ||
reset() | ||
} else { | ||
toggleItem(selectedItem) | ||
} |
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.
See above 👀
} | ||
|
||
const listItems = [ | ||
SELECT_ALL_BUTTON, | ||
...selectedItems, | ||
...items?.filter((item) => !isItemSelected(item, selectedItems)), | ||
...(items?.filter((item) => !isItemSelected(item, selectedItems)) ?? []), |
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.
Handling the case where items is undefined
614ae25
to
125652e
Compare
Description
Note
Requires #3508 to be merged before reviewing.
This PR applies the recommended rules from
eslint
andtypescript-eslint
Ticket: codecov/engineering-team#2124
Notable Changes
eslint:recommended
andplugin:@typescript-eslint/recommended
ts-expect-error
with no message_
to the argument{}
toobject
or correct type!!
when they're not needed such as in conditionalslet
toconst
for values that aren't being reassigned