Make type_contents_order to enable placement init() in SwiftUI views above computed properties
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
I think for SwiftUI views such order should be supported by default
Or there should be possibility to exclude some content types from ordering like only initializers to enable random placing.
struct MainTabView: View {
@StateObject var tabState: TabState
init(state: TabState) {
_tabState = StateObject(wrappedValue: state)
}
var body: some View {
TabView(selection: $tabState.selection) {
DashboardView()
ProfileView()
}
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the type_contents_order rule and its configuration, then compare its current ordering behavior with the SwiftUI example in the issue. Done means initializers can be placed above computed properties by default or the relevant content types can be excluded from ordering, with coverage for the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100