From 8b2129f01cf023ec70df1d090c614bd01c7b3fe6 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Fri, 27 Feb 2026 11:31:45 +0100 Subject: [PATCH] chore: fix swiftlint scanning dependency files 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. --- package-lock.json | 22 +++++++------------ package.json | 1 + packages/barcode-scanning/.swiftlintrc.js | 1 + packages/barcode-scanning/package.json | 2 -- packages/document-scanner/.swiftlintrc.js | 1 + packages/document-scanner/package.json | 2 -- packages/face-detection/.swiftlintrc.js | 1 + packages/face-detection/package.json | 2 -- packages/face-mesh-detection/.swiftlintrc.js | 1 + packages/face-mesh-detection/package.json | 2 -- packages/selfie-segmentation/.swiftlintrc.js | 1 + packages/selfie-segmentation/package.json | 2 -- packages/subject-segmentation/.swiftlintrc.js | 1 + packages/subject-segmentation/package.json | 2 -- packages/translation/.swiftlintrc.js | 1 + packages/translation/package.json | 2 -- swiftlint.config.js | 10 +++++++++ 17 files changed, 26 insertions(+), 28 deletions(-) create mode 100644 packages/barcode-scanning/.swiftlintrc.js create mode 100644 packages/document-scanner/.swiftlintrc.js create mode 100644 packages/face-detection/.swiftlintrc.js create mode 100644 packages/face-mesh-detection/.swiftlintrc.js create mode 100644 packages/selfie-segmentation/.swiftlintrc.js create mode 100644 packages/subject-segmentation/.swiftlintrc.js create mode 100644 packages/translation/.swiftlintrc.js create mode 100644 swiftlint.config.js diff --git a/package-lock.json b/package-lock.json index b13a735..9accd95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ ], "devDependencies": { "@changesets/cli": "2.29.8", + "@ionic/swiftlint-config": "2.0.0", "@robingenz/changelog-github": "0.0.1", "patch-package": "8.0.1", "pkg-pr-new": "0.0.20", @@ -7474,7 +7475,7 @@ }, "packages/barcode-scanning": { "name": "@capacitor-mlkit/barcode-scanning", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7493,7 +7494,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7524,7 +7524,7 @@ }, "packages/document-scanner": { "name": "@capacitor-mlkit/document-scanner", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7543,7 +7543,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7574,7 +7573,7 @@ }, "packages/face-detection": { "name": "@capacitor-mlkit/face-detection", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7593,7 +7592,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7624,7 +7622,7 @@ }, "packages/face-mesh-detection": { "name": "@capacitor-mlkit/face-mesh-detection", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7643,7 +7641,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7674,7 +7671,7 @@ }, "packages/selfie-segmentation": { "name": "@capacitor-mlkit/selfie-segmentation", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7693,7 +7690,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7724,7 +7720,7 @@ }, "packages/subject-segmentation": { "name": "@capacitor-mlkit/subject-segmentation", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7743,7 +7739,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -7774,7 +7769,7 @@ }, "packages/translation": { "name": "@capacitor-mlkit/translation", - "version": "7.0.0", + "version": "8.0.1", "funding": [ { "type": "github", @@ -7793,7 +7788,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", diff --git a/package.json b/package.json index 6c90c41..bb66514 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@changesets/cli": "2.29.8", + "@ionic/swiftlint-config": "2.0.0", "@robingenz/changelog-github": "0.0.1", "patch-package": "8.0.1", "pkg-pr-new": "0.0.20", diff --git a/packages/barcode-scanning/.swiftlintrc.js b/packages/barcode-scanning/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/barcode-scanning/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/barcode-scanning/package.json b/packages/barcode-scanning/package.json index 5726a8b..2ef10bb 100644 --- a/packages/barcode-scanning/package.json +++ b/packages/barcode-scanning/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/document-scanner/.swiftlintrc.js b/packages/document-scanner/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/document-scanner/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/document-scanner/package.json b/packages/document-scanner/package.json index 5ee88d0..2c6ca6b 100644 --- a/packages/document-scanner/package.json +++ b/packages/document-scanner/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/face-detection/.swiftlintrc.js b/packages/face-detection/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/face-detection/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/face-detection/package.json b/packages/face-detection/package.json index b58a238..3dbd1d8 100644 --- a/packages/face-detection/package.json +++ b/packages/face-detection/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/face-mesh-detection/.swiftlintrc.js b/packages/face-mesh-detection/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/face-mesh-detection/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/face-mesh-detection/package.json b/packages/face-mesh-detection/package.json index d393b1a..47593f5 100644 --- a/packages/face-mesh-detection/package.json +++ b/packages/face-mesh-detection/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/selfie-segmentation/.swiftlintrc.js b/packages/selfie-segmentation/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/selfie-segmentation/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/selfie-segmentation/package.json b/packages/selfie-segmentation/package.json index b411099..ac37d05 100644 --- a/packages/selfie-segmentation/package.json +++ b/packages/selfie-segmentation/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/subject-segmentation/.swiftlintrc.js b/packages/subject-segmentation/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/subject-segmentation/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/subject-segmentation/package.json b/packages/subject-segmentation/package.json index 06c85a9..26260af 100644 --- a/packages/subject-segmentation/package.json +++ b/packages/subject-segmentation/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/packages/translation/.swiftlintrc.js b/packages/translation/.swiftlintrc.js new file mode 100644 index 0000000..73548d4 --- /dev/null +++ b/packages/translation/.swiftlintrc.js @@ -0,0 +1 @@ +module.exports = require('../../swiftlint.config.js'); diff --git a/packages/translation/package.json b/packages/translation/package.json index 3fe52b2..16c1043 100644 --- a/packages/translation/package.json +++ b/packages/translation/package.json @@ -62,7 +62,6 @@ "@capacitor/docgen": "0.3.1", "@capacitor/ios": "8.0.0", "@ionic/eslint-config": "0.4.0", - "@ionic/swiftlint-config": "2.0.0", "eslint": "8.57.0", "prettier": "3.4.2", "prettier-plugin-java": "2.6.7", @@ -74,7 +73,6 @@ "peerDependencies": { "@capacitor/core": ">=8.0.0" }, - "swiftlint": "@ionic/swiftlint-config", "eslintConfig": { "extends": "@ionic/eslint-config/recommended" }, diff --git a/swiftlint.config.js b/swiftlint.config.js new file mode 100644 index 0000000..75b6d63 --- /dev/null +++ b/swiftlint.config.js @@ -0,0 +1,10 @@ +const base = require('@ionic/swiftlint-config'); + +module.exports = { + ...base, + excluded: [ + ...(base.excluded || []).map((p) => p.replace('${PWD}', process.cwd())), + `${process.cwd()}/.build`, + `${process.cwd()}/example`, + ], +};