The built-in Capacitor plugin in knip incorrectly reports @capacitor/ios as an unused dependency when a Capacitor project's iOS target is configured with Swift Package Manager (SPM) instead of CocoaPods.
Starting with Capacitor 6, iOS projects can use SPM as an alternative to CocoaPods. In that setup, the iOS project typically contains a Swift package manifest (for example, ios/App/CapApp-SPM/Package.swift) and does not include an ios/App/Podfile.
The issue appears to be that knip's Capacitor plugin only checks for the presence of a CocoaPods Podfile when determining whether the iOS platform is installed. As a result, SPM-based projects are treated as if the iOS platform is missing, causing @capacitor/ios to be flagged as unused even though it is required and actively used to build the iOS application.
Happy to put up a PR if it would be welcome. Thanks for making such a useful piece of software!
The built-in Capacitor plugin in knip incorrectly reports @capacitor/ios as an unused dependency when a Capacitor project's iOS target is configured with Swift Package Manager (SPM) instead of CocoaPods.
Starting with Capacitor 6, iOS projects can use SPM as an alternative to CocoaPods. In that setup, the iOS project typically contains a Swift package manifest (for example, ios/App/CapApp-SPM/Package.swift) and does not include an ios/App/Podfile.
The issue appears to be that knip's Capacitor plugin only checks for the presence of a CocoaPods Podfile when determining whether the iOS platform is installed. As a result, SPM-based projects are treated as if the iOS platform is missing, causing @capacitor/ios to be flagged as unused even though it is required and actively used to build the iOS application.
Happy to put up a PR if it would be welcome. Thanks for making such a useful piece of software!