Conversation
Zed + Opus 4.6; prompt: Run `make lint-js`. You'll get a lot of warnings back. Fix _at least_ the easiest 20%.
Zed + Opus 4.6; prompt: Resolve the low-hanging fruit on `no-explicit-any`. Goal is to cut the number of warnings there in half.
Zed + Opus 4.6, same conversation as the primary commit; prompt: Nice. Next up, fix the `consistent-return` issues.
Zed + Opus 4.6, same conversation as previous commit; prompt: Next, fix the `react/no-unused-prop-types` warnings.
Zed + Opus 4.6, same conversation as previous commit; prompt: Next, fix the `react-hooks/exhaustive-deps` issues
Zed + Opus 4.6 from same conversation as last commit; prompt: Next, fix the `@typescript-eslint/no-non-null-assertion` issues
Zed + Opus 4.6; prompt: Next, fix no-constant-condition and no-alert issues, then react/no-danger, at which point we should have a clean linting run
Zed + Opus 4.6; prompt: Tests are broken on this branch right now, including an OOM. See job-logs.txt for more details (particularly toward the end of the file). Fix the issues so tests pass.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #43387 +/- ##
==========================================
- Coverage 66.90% 66.87% -0.03%
==========================================
Files 2596 2591 -5
Lines 208220 207635 -585
Branches 9208 9226 +18
==========================================
- Hits 139314 138861 -453
+ Misses 56235 56144 -91
+ Partials 12671 12630 -41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| interface IAppProps { | ||
| children: JSX.Element; | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| const [addedSoftwareToken, setAddedSoftwareToken] = useState<string | null>( | ||
| null | ||
| ); | ||
| const [addedSoftwareToken] = useState<string | null>(null); |
There was a problem hiding this comment.
why is this a use state then, double check.
There was a problem hiding this comment.
⏺ So the intent was: when you add software via VPP or package upload, set a token to trigger a React Query refetch on the sibling software
list. The token goes into the query key, so changing it invalidates the cache.
The problem is setAddedSoftwareToken is never called — the wiring from the add-software flow to the setter was either never completed or
got lost in a refactor. Let me check if React Query invalidation is handling this differently now:
Searched for 4 patterns (ctrl+o to expand)
⏺ The add-software flows (VPP, Fleet-maintained, custom package) all now use queryClient.invalidateQueries({ queryKey: [{ scope:
"software-titles" }] }) to bust the cache directly. The addedSoftwareToken approach was the original solution from PR #20973, but it's
been superseded by proper query invalidation. The token mechanism is dead code now — setAddedSoftwareToken is never called, and
addedSoftwareToken is permanently null.
Safe to remove entirely. It's vestigial from before the invalidateQueries calls were added.
TODO: Removing this completely
| <SoftwareAndroidForm | ||
| onSubmit={onAddSoftware} | ||
| onCancel={goBackToSoftwareTitles} | ||
| onClickPreviewEndUserExperience={onClickPreviewEndUserExperience} |
There was a problem hiding this comment.
look to see if this was intentional
| onSubmit, | ||
| isLoading = false, | ||
| onCancel, | ||
| onClickPreviewEndUserExperience, |
There was a problem hiding this comment.
look to see if this was intentional
| setLastEditedQueryDiscardData(DEFAULT_QUERY.discard_data); | ||
| } | ||
| }, [queryId]); | ||
| }, [ |
There was a problem hiding this comment.
will need to go through all use effect dependencies, I vaguely remember adverse effects many moons ago
| hostStatusWebhookHostPercentage, | ||
| (val) => `${val}%` | ||
| ), | ||
| // intentionally omit dependency so options only computed initially |
There was a problem hiding this comment.
this. So will need to fix accordingly
| // it's safe to assume that frequency is a number | ||
| (frequency: number | string) => `${frequency as number} days` | ||
| ), | ||
| // intentionally leave activityExpiryWindow out of the dependencies, so that the custom |
There was a problem hiding this comment.
this. So will need to fix accordingly
| {} | ||
| ); | ||
| const [error, setError] = useState<Error | null>(null); | ||
| const [error] = useState<Error | null>(null); |
|
|
||
| // Create a simple mock SVG component for matched icons | ||
| const MockSvgIcon = ({ width, height, className }: any) => ( | ||
| /* eslint-disable react/prop-types */ |
## Issue - First batch of @iansltx 's work of cleaning up lint warnings #43387 ## Description - Quick PR review and grabbed as many confirmed low-risk quick wins as I could `git checkout lint-cleanup <file/path/1> <file/path/2>` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes This release contains internal code improvements with one minor UI tweak: * **Style** * Dropdown menu background color adjusted for clearer contrast in action lists * **Refactor** * Improved type safety across the codebase with stricter TypeScript annotations * Removed unused imports and constants to reduce code clutter * Enhanced React hook dependency arrays for more consistent component behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Rachel Perkins <rachel@Rachels-MacBook-Pro.local> Co-authored-by: Ian Littman <iansltx@gmail.com>
| /> | ||
| ); | ||
| }, [curTargetedPlatformFilter, queryParams, router]); | ||
| }, [curTargetedPlatformFilter, handlePlatformFilterDropdownChange]); |
| setCurrentTeam(querysTeam); | ||
| } | ||
| }, [storedQuery]); | ||
| }, [storedQuery, availableTeams, setCurrentTeam]); |
There was a problem hiding this comment.
Adding availableTeams is safe and correct — there's a real scenario where storedQuery loads before availableTeams is populated, so the
.find() returns undefined. When availableTeams later fills in, the effect should re-run.
Adding setCurrentTeam is safe but unnecessary — it's a context setter, so its reference is stable. Including it won't cause extra re-runs,
and it satisfies the exhaustive-deps lint rule.
| const { hosts: hostResponses, uiHostCounts, serverHostCounts, errors } = | ||
| campaign || {}; | ||
|
|
||
| const totalRowsCount = get(campaign, ["hosts_count", "successful"], 0); |
There was a problem hiding this comment.
unused, we use uiHostCounts defined above
|
|
||
| const onQueryChange = useCallback( | ||
| (queryData: any) => { | ||
| (queryData: ITableQueryData) => { |
There was a problem hiding this comment.
👍 it's what we do elsewhere too
| return IPadOSUpdateScreenshot; | ||
| default: | ||
| MacOSUpdateScreenshot; | ||
| return MacOSUpdateScreenshot; |
| INumberDropdownOption, | ||
| false, | ||
| GroupBase<INumberDropdownOption> | ||
| > |
No description provided.