Skip to content

refactor: replace any type assertion with Parameters<typeof writeHtmlReport>[0]#439

Merged
sonukapoor merged 1 commit into
OWASP:mainfrom
AnupamKumar-1:fix/remove-any-type-assertion-cli-integration
May 25, 2026
Merged

refactor: replace any type assertion with Parameters<typeof writeHtmlReport>[0]#439
sonukapoor merged 1 commit into
OWASP:mainfrom
AnupamKumar-1:fix/remove-any-type-assertion-cli-integration

Conversation

@AnupamKumar-1
Copy link
Copy Markdown
Contributor

Closes #438

Summary

Replaced const callArgs: any with const callArgs: Parameters<typeof writeHtmlReport>[0] on line 867 — inline, no extra import needed.

Why this change

any bypasses TypeScript's type checker. Proper type ensures compile-time safety.

What changed

  • tests/cli-integration.test.ts line 867: anyParameters<typeof writeHtmlReport>[0]

Validation

npm test — 326 tests pass
npm run build — build clean

User-facing impact

  • affect scanning behavior
  • affect output formatting
  • affect JSON output
  • affect docs only

Notes

Test file change only, no runtime behaviour changed.

Copy link
Copy Markdown
Collaborator

@sonukapoor sonukapoor left a comment

Choose a reason for hiding this comment

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

Clean change. Parameters<typeof writeHtmlReport>[0] is the right type here - no extra import needed and stays in sync automatically if the function signature ever changes.

One thing before this can merge: the branch is behind main. Could you rebase against main and force-push?

@AnupamKumar-1 AnupamKumar-1 force-pushed the fix/remove-any-type-assertion-cli-integration branch from 751444e to 11454e9 Compare May 25, 2026 12:43
@AnupamKumar-1
Copy link
Copy Markdown
Contributor Author

Rebased against main and force-pushed the updated branch. Thanks for the review!

@sonukapoor sonukapoor merged commit c4580fd into OWASP:main May 25, 2026
6 checks passed
@sonukapoor
Copy link
Copy Markdown
Collaborator

@AnupamKumar-1 Thank you for your contributions.

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.

refactor: remove any type assertion in tests/cli-integration.test.ts

2 participants