Member-only story
Fixing SwiftLint Configuration Not Working in Monorepo Projects
TL;DR: SwiftLint may fail to apply lint rules in monorepo setups when packages are opened individually in VSCode or Cursor. To fix this, configure
swiftlint.configSearchPaths
in both root and sub-package.vscode/settings.json
files to correctly locate the shared.swiftlint.yml
. Also, explicitly defineincluded
paths in the config file (wildcards won't work) to ensure proper linting across all modules.
Stay ahead with the latest updates and deep insights on Swift, SwiftUI, Core Data, and SwiftData. Subscribe to Fatbobman’s Swift Weekly to get exclusive articles, tips, and curated resources delivered straight to your inbox every week.
For even more valuable content and in-depth tutorials, visit my blog at fatbobman.com — your go-to destination for all things Swift and Apple development.
Background
When managing Swift projects using a monorepo structure, developers often create a single .swiftlint.yml
configuration file in the root directory. However, when opening the project root or a specific Package…