Skip to content

FE: Clean up lint warnings part III - #44065

Merged
RachelElysia merged 2 commits into
mainfrom
lint-cleanup-iii
Apr 24, 2026
Merged

FE: Clean up lint warnings part III#44065
RachelElysia merged 2 commits into
mainfrom
lint-cleanup-iii

Conversation

@RachelElysia

@RachelElysia RachelElysia commented Apr 23, 2026

Copy link
Copy Markdown
Member

Description

  • More lint fixes to reduce the number of lint-js warnings on github ci
  • Third of many PRs, this just cleaned up 20 warnings of unused variables
    • 461 --> 343 warnings left to clean up

Summary by CodeRabbit

  • Refactor

    • Removed end-user preview functionality from the Android software configuration flow.
    • Simplified configuration error handling so displayed error text no longer depends on installer context.
  • Chores

    • Cleaned up unused imports/constants and removed unreachable/commented snippets across several frontend pages.
  • Tests

    • Minor test import cleanups (no behavioral changes).

router.push(getPathWithQueryParams(PATHS.SOFTWARE_TITLES, queryParams));
};

const onClickPreviewEndUserExperience = () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed preview end user experience modal from this UI when we moved advanced options out of the add software flows. This is all now unused code.

@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 65.06%. Comparing base (0dbd9f7) to head (a6ebf1b).
⚠️ Report is 71 commits behind head on main.

Files with missing lines Patch % Lines
.../EditConfigurationModal/EditConfigurationModal.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #44065      +/-   ##
==========================================
- Coverage   65.07%   65.06%   -0.01%     
==========================================
  Files        2609     2616       +7     
  Lines      254482   254845     +363     
  Branches     9305     9540     +235     
==========================================
+ Hits       165596   165814     +218     
- Misses      76078    76220     +142     
- Partials    12808    12811       +3     
Flag Coverage Δ
frontend 54.80% <50.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

try {
const {
software_title_id: softwareAppStoreTitleId,
// Maybe this will return name and can render success message with the name?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turned this into a bug #44067
Draft PR here #44068

@RachelElysia
RachelElysia marked this pull request as ready for review April 23, 2026 17:48
@RachelElysia
RachelElysia requested a review from a team as a code owner April 23, 2026 17:48
Copilot AI review requested due to automatic review settings April 23, 2026 17:48

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the frontend lint-warnings cleanup by removing unused imports/variables/props across several React components and tests.

Changes:

  • Remove unused imports and unused destructured values from various components/tests.
  • Remove an unused Android “preview end user experience” modal/state wiring.
  • Simplify the Android configuration modal error helper (but currently introduces a TS call-site mismatch).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx Removes unused helper/component imports and unused AppContext values.
frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx Removes unused constant import.
frontend/pages/hosts/details/HostQueryReport/HostQueryReport.tsx Removes unused Link import.
frontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsx Removes unused paths import.
frontend/pages/admin/TeamManagementPage/components/RenameTeamModal/RenameTeamModal.tests.tsx Removes unused waitFor import.
frontend/pages/SoftwarePage/components/tables/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx Removes unused constants import.
frontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsx Removes unused prop from the form props/interface.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx Changes getErrorMessage signature; currently inconsistent with caller usage.
frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsx Removes unused imports/state and stops passing removed preview prop.
frontend/components/forms/fields/Checkbox/Checkbox.tsx Removes unused destructured prop while still passing helpText through to FormField.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// eslint-disable-next-line import/prefer-default-export
export const getErrorMessage = (err: unknown, software: IAppStoreApp) => {
export const getErrorMessage = (err: unknown) => {

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getErrorMessage now only accepts one argument, but it’s still called with two args in EditConfigurationModal.tsx (e.g. getErrorMessage(e, softwareInstaller as IAppStoreApp)), which will fail TypeScript type-checking. Either update the call site(s) to pass only err, or keep the second parameter (e.g. make it optional and/or prefix with _ to satisfy lint) to preserve the existing API surface.

Suggested change
export const getErrorMessage = (err: unknown) => {
export const getErrorMessage = (err: unknown, _appStoreApp?: unknown) => {

Copilot uses AI. Check for mistakes.
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c46b0f83-dea3-4002-a814-4f0e6f913d63

📥 Commits

Reviewing files that changed from the base of the PR and between f140bba and a6ebf1b.

📒 Files selected for processing (1)
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/EditConfigurationModal.tsx

Walkthrough

This pull request removes unused props, parameters, state, and imports across multiple frontend files. Notable changes: getErrorMessage signature in EditConfigurationModal helpers is simplified to one parameter; onClickPreviewEndUserExperience and related preview state/logic are removed from SoftwareAndroidForm and SoftwareAppStoreAndroid; Checkbox prop handling is adjusted to stop destructuring helpText; several unused imports and test imports are pruned. No exported API signatures were broadly changed except the helper and form prop updates noted.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'FE: Clean up lint warnings part III' clearly summarizes the main change: frontend lint cleanup as the third part of a series.
Description check ✅ Passed The description provides sufficient context: it explains the purpose (reducing lint-js warnings), identifies this as the third PR in a series, and quantifies the cleanup (20 warnings, 461→343 remaining).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lint-cleanup-iii

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx`:
- Line 9: Call sites still pass two arguments to getErrorMessage but its
signature was changed to accept only one; update the call in
EditConfigurationModal.tsx to call getErrorMessage(e) (remove the second arg:
softwareInstaller as IAppStoreApp) and then remove the now-unused IAppStoreApp
import from that file if it has no other references. Ensure the only usage of
getErrorMessage matches the single-parameter signature across the file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3d35f083-a1c1-48aa-89a7-0ba409493436

📥 Commits

Reviewing files that changed from the base of the PR and between c3d89fa and f140bba.

📒 Files selected for processing (10)
  • frontend/components/forms/fields/Checkbox/Checkbox.tsx
  • frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx
  • frontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsx
  • frontend/pages/SoftwarePage/components/tables/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx
  • frontend/pages/admin/TeamManagementPage/components/RenameTeamModal/RenameTeamModal.tests.tsx
  • frontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsx
  • frontend/pages/hosts/details/HostQueryReport/HostQueryReport.tsx
  • frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx
  • frontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx
💤 Files with no reviewable changes (4)
  • frontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsx
  • frontend/components/forms/fields/Checkbox/Checkbox.tsx
  • frontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsx
  • frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsx


// eslint-disable-next-line import/prefer-default-export
export const getErrorMessage = (err: unknown, software: IAppStoreApp) => {
export const getErrorMessage = (err: unknown) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Call site not updated to match new signature.

getErrorMessage was narrowed to a single parameter, but the caller in EditConfigurationModal.tsx (lines 109-114 per the provided snippet) still invokes it as getErrorMessage(e, softwareInstaller as IAppStoreApp). This will fail TypeScript compilation (TS2554: expected 1 argument, got 2) and the related IAppStoreApp import there likely becomes unused as well.

🔧 Proposed fix in EditConfigurationModal.tsx
 } catch (e) {
       renderFlash(
         "error",
-        getErrorMessage(e, softwareInstaller as IAppStoreApp)
+        getErrorMessage(e)
       );
     }

Also remove the now-unused IAppStoreApp import in EditConfigurationModal.tsx if no other references remain.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx`
at line 9, Call sites still pass two arguments to getErrorMessage but its
signature was changed to accept only one; update the call in
EditConfigurationModal.tsx to call getErrorMessage(e) (remove the second arg:
softwareInstaller as IAppStoreApp) and then remove the now-unused IAppStoreApp
import from that file if it has no other references. Ensure the only usage of
getErrorMessage matches the single-parameter signature across the file.

cdcme
cdcme previously approved these changes Apr 23, 2026
@RachelElysia
RachelElysia merged commit 68e1585 into main Apr 24, 2026
19 checks passed
@RachelElysia
RachelElysia deleted the lint-cleanup-iii branch April 24, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants