chore: fix swiftlint scanning dependency files#323
Merged
Conversation
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.
There was a problem hiding this comment.
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.jsthat expands${PWD}toprocess.cwd()at evaluation time and appends additional excludes. - Added per-package
.swiftlintrc.jsfiles delegating to the shared root config. - Centralized
@ionic/swiftlint-configinto the rootdevDependenciesand 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.
@capacitor-mlkit/barcode-scanning
@capacitor-mlkit/document-scanner
@capacitor-mlkit/face-detection
@capacitor-mlkit/face-mesh-detection
@capacitor-mlkit/selfie-segmentation
@capacitor-mlkit/subject-segmentation
@capacitor-mlkit/translation
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
node-swiftlintwrites the@ionic/swiftlint-configas 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:
swiftlint.config.jsthat resolves${PWD}at JS evaluation time.swiftlintrc.jsthat delegates to the shared root config@ionic/swiftlint-configfrom per-package to root devDependencies