## Summary
Convert AccessibilityTraitForButtonRule to use SwiftSyntax instead of
SourceKit for improved performance and better accessibility trait
detection in SwiftUI modifier chains.
## Key Technical Improvements
- **Bidirectional modifier chain analysis** for comprehensive
accessibility trait detection
- **Better context awareness** through SwiftSyntax tree traversal
- **Accurate container exemption logic** for Button/Link components
- **Enhanced gesture detection** supporting `.onTapGesture` and
`.gesture` modifiers
- **Improved performance** with SwiftSyntax visitor pattern over
SourceKit AST parsing
## Migration Details
- Replaced `ASTRule` with `@SwiftSyntaxRule(optIn: true)` annotation
- Implemented `ViolationsSyntaxVisitor` pattern for systematic tree
traversal
- Added bidirectional accessibility trait detection that checks both
before and after tap gestures
- Enhanced exemption logic for inherently accessible containers
(Button, NavigationLink)
- Maintained full compatibility with existing rule behavior and test
cases
Main goal is to bring implementations, rules and examples closer together.
Another advantage is that the rule's layouts are in line with other
`@SwiftSyntaxRule`s.
After the refactoring, violation messages can be
better adapted to the object causing the issue. Violation positions
should be harmonized and more cases for protocols, subscripts and
deinitializers can be added.
Convert FileLengthRule to use SwiftSyntax instead of SourceKit for
improved performance and fewer false positives.
The SwiftSyntax implementation:
- Uses ViolationsSyntaxVisitor pattern with token traversal
- Correctly handles multiline tokens by counting all spanned lines
- Properly excludes comment-only and whitespace-only lines
- Accurately attributes trivia to correct line positions
- Extracts common line range logic to reduce code duplication
Tasks we perform with Sourcery are rather simple and can be replaced
with a basic collection of files and the generation of lists in the
new `swiftlint-dev` command. This spares contributors from installing
either Sourcery or Bazel.