Skip to content

Comments

refactor: replace any type with unknown in type definitions#6509

Merged
chenjiahan merged 1 commit intomainfrom
replace_any_1105
Nov 5, 2025
Merged

refactor: replace any type with unknown in type definitions#6509
chenjiahan merged 1 commit intomainfrom
replace_any_1105

Conversation

@chenjiahan
Copy link
Member

Summary

Replace usage of any type with unknown in various type definitions across multiple plugins to improve type safety and maintainability.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 5, 2025 13:04
@netlify
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit d785b9f
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/690b4b52b2b9ec0008280401
😎 Deploy Preview https://deploy-preview-6509--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 60 (🔴 down 9 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

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 improves type safety by replacing the use of any with unknown types across multiple plugin packages and test helper code. This change enforces stricter type checking and prevents unintentional type bypasses.

  • Replaced Record<string, any> with Record<string, unknown> in type guards and interface definitions
  • Updated function parameter types from any[] to unknown[] for better type safety
  • Added explicit type definition for ResolveUrlJoinItem in the Sass plugin helper

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-vue/src/splitChunks.ts Updated isPlainObject type guard return type from any to unknown
packages/plugin-svelte/src/index.ts Changed index signature types in SvelteLoaderOptions from any to unknown
packages/plugin-sass/src/helpers.ts Updated callback parameter types and added explicit ResolveUrlJoinItem type
packages/plugin-react/src/splitChunks.ts Updated isPlainObject type guard return type from any to unknown
packages/plugin-less/src/index.ts Updated isPlainObject return type from any to unknown
e2e/helper/logs.ts Changed console method parameter type from any[] to unknown[]

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

@chenjiahan chenjiahan merged commit 22d3373 into main Nov 5, 2025
18 checks passed
@chenjiahan chenjiahan deleted the replace_any_1105 branch November 5, 2025 13:15
@chenjiahan chenjiahan mentioned this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant