Skip to content

chore: fix swiftlint scanning dependency files#323

Merged
robingenz merged 1 commit intomainfrom
chore/fix-swiftlint-dependency-scanning
Feb 27, 2026
Merged

chore: fix swiftlint scanning dependency files#323
robingenz merged 1 commit intomainfrom
chore/fix-swiftlint-dependency-scanning

Conversation

@robingenz
Copy link
Copy Markdown
Member

node-swiftlint writes the @ionic/swiftlint-config as JSON to a temp file, but SwiftLint only expands ${PWD} in YAML configs. This means the exclusion rules were silently broken — swiftlint was scanning all dependency files (.build/, ios/Pods/, example/).

Changes:

  • Add root swiftlint.config.js that resolves ${PWD} at JS evaluation time
  • Add per-package .swiftlintrc.js that delegates to the shared root config
  • Move @ionic/swiftlint-config from per-package to root devDependencies

node-swiftlint writes config as JSON but SwiftLint only expands
${PWD} in YAML, so exclusion rules from @ionic/swiftlint-config
were silently broken. Add a shared swiftlint.config.js that resolves
paths at JS evaluation time and per-package .swiftlintrc.js files.
Also move @ionic/swiftlint-config to root devDependencies.
Copy link
Copy Markdown

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 fixes SwiftLint exclusion handling in the monorepo by ensuring ${PWD} is resolved before node-swiftlint emits a JSON config, preventing SwiftLint from scanning dependency/build directories.

Changes:

  • Added a root swiftlint.config.js that expands ${PWD} to process.cwd() at evaluation time and appends additional excludes.
  • Added per-package .swiftlintrc.js files delegating to the shared root config.
  • Centralized @ionic/swiftlint-config into the root devDependencies and removed per-package references.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
swiftlint.config.js Introduces shared SwiftLint config wrapper that expands ${PWD} and sets excludes.
package.json Adds @ionic/swiftlint-config at the workspace root.
package-lock.json Updates lockfile for moved dependency; also includes workspace package metadata changes.
packages/translation/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/translation/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/subject-segmentation/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/subject-segmentation/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/selfie-segmentation/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/selfie-segmentation/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/face-mesh-detection/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/face-mesh-detection/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/face-detection/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/face-detection/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/document-scanner/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/document-scanner/.swiftlintrc.js Delegates SwiftLint config to root wrapper.
packages/barcode-scanning/package.json Removes per-package @ionic/swiftlint-config usage and swiftlint config pointer.
packages/barcode-scanning/.swiftlintrc.js Delegates SwiftLint config to root wrapper.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

@capacitor-mlkit/barcode-scanning

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/barcode-scanning@323

@capacitor-mlkit/document-scanner

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/document-scanner@323

@capacitor-mlkit/face-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-detection@323

@capacitor-mlkit/face-mesh-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-mesh-detection@323

@capacitor-mlkit/selfie-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/selfie-segmentation@323

@capacitor-mlkit/subject-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/subject-segmentation@323

@capacitor-mlkit/translation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/translation@323

commit: 8b2129f

@robingenz robingenz merged commit 84e52d1 into main Feb 27, 2026
10 checks passed
@robingenz robingenz deleted the chore/fix-swiftlint-dependency-scanning branch February 27, 2026 11:26
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.

2 participants