Skip to content

fix(types): make PostCSSPlugin type loose#5448

Merged
chenjiahan merged 1 commit intomainfrom
postcss_plugin_type_0619
Jun 19, 2025
Merged

fix(types): make PostCSSPlugin type loose#5448
chenjiahan merged 1 commit intomainfrom
postcss_plugin_type_0619

Conversation

@chenjiahan
Copy link
Member

Summary

Use a loose PostCSS plugin type that accepts plugins from different PostCSS versions. This helps avoid type conflicts when user projects use different PostCSS versions.

Related Links

resolve #5439

Checklist

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

Copilot AI review requested due to automatic review settings June 19, 2025 13:30
@netlify
Copy link

netlify bot commented Jun 19, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 9f384c3
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/685410e55e37da00083aeae8
😎 Deploy Preview https://deploy-preview-5448--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: 74 (🔴 down 4 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 updates the PostCSS plugin type in order to support plugins from different PostCSS versions by introducing a loose type.

  • Added a new loose type (LoosePostCSSPlugin) in thirdParty.ts.
  • Updated PostCSSOptions and configuration types in config.ts to use the loose type.

Reviewed Changes

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

File Description
packages/core/src/types/thirdParty.ts Added LoosePostCSSPlugin and updated PostCSSOptions.
packages/core/src/types/config.ts Updated import and function signature to use LoosePostCSSPlugin.
Comments suppressed due to low confidence (1)

packages/core/src/types/thirdParty.ts:25

  • [nitpick] Using 'any' for LoosePostCSSPlugin achieves the goal of flexibility, but consider using 'unknown' instead of 'any' to maintain a minimal level of type safety while still accommodating multiple PostCSS versions.
export type LoosePostCSSPlugin = any;

@chenjiahan chenjiahan merged commit e4481c8 into main Jun 19, 2025
12 checks passed
@chenjiahan chenjiahan deleted the postcss_plugin_type_0619 branch June 19, 2025 13:38
This was referenced Jun 20, 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.

[Bug]: Types for PostCSS addPlugins are broken

1 participant