Skip to content

HMS-9826: add typescript config, migrate small component to TS#1535

Open
xbhouse wants to merge 5 commits intoRedHatInsights:masterfrom
xbhouse:9826
Open

HMS-9826: add typescript config, migrate small component to TS#1535
xbhouse wants to merge 5 commits intoRedHatInsights:masterfrom
xbhouse:9826

Conversation

@xbhouse
Copy link
Collaborator

@xbhouse xbhouse commented Mar 6, 2026

Description

Associated Jira ticket: HMS-9826

This PR adds initial Typescript support and migrates the CvesModal SmartComponent as a first example

  • Installs additional TS packages and updates Jest, Babel, and ESlint configs to support TS. Splits the ESlint config into separate sections for JS and TS, different configs are needed for JS and TS components and Playwright tests
  • Changes the noImplicitAny option in the tsconfig to false to ease the initial migration, but we should still aim to define types when it's possible
  • Migrates the CvesModal SmartComponent and its related unit tests, API, and Redux components to TS
  • Migrates some utilities used by these components, while leaving others in JS to demonstrate that JS modules can still be consumed by TS components during an incremental migration

How to test the PR

  • Run the app and ensure everything still works as expected, especially the CvesModal on the AdvisoryDetail page
  • Tests should pass

Before the change

After the change

Dependent work link

Checklist:

  • The commit message has the Jira ticket linked
  • PR has a short description
  • Screenshots before and after the change are added
  • Tests for the changes have been added
  • README.md is updated if necessary
  • Needs additional dependent work

xbhouse added 5 commits March 6, 2026 12:28
- move vulnerability api to separate file for easier migration
- update imports
- move actions specific to cves to separate file for easier migration
- convert cve store and test to ts
- add typed hooks to use in components
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 85.41667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.81%. Comparing base (df141b3) to head (ecee95b).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/Utilities/api/vulnerabilityApi.ts 14.28% 6 Missing ⚠️
src/SmartComponents/AdvisoryDetail/CvesModal.tsx 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1535      +/-   ##
==========================================
+ Coverage   73.67%   77.81%   +4.14%     
==========================================
  Files          97      102       +5     
  Lines        2359     3070     +711     
  Branches      666      666              
==========================================
+ Hits         1738     2389     +651     
- Misses        551      615      +64     
+ Partials       70       66       -4     
Flag Coverage Δ
combined 77.81% <85.41%> (?)
jest 77.81% <85.41%> (?)

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.

@xbhouse xbhouse marked this pull request as ready for review March 6, 2026 21:43
@xbhouse xbhouse requested a review from a team as a code owner March 6, 2026 21:43
@katarinazaprazna katarinazaprazna self-assigned this Mar 9, 2026
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