Created
February 7, 2023 09:59
-
-
Save chriseidhof/d8c079ca97099a6122f37890a144e9b0 to your computer and use it in GitHub Desktop.
SwiftLint rules for state, state object, environment and scaled metric
This file contains 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
disabled_rules: | |
- trailing_comma | |
opt_in_rules: | |
- file_header | |
file_header: | |
forbidden_pattern: /./ | |
custom_rules: | |
state_private: | |
name: "Private SwiftUI State" | |
regex: "\\@State\\s*var" | |
message: "SwiftUI @State variables should always be marked private." | |
severity: warning | |
state_object_private: | |
name: "Private SwiftUI StateObject" | |
regex: "\\@StateObject\\s*var" | |
message: "SwiftUI @StateObject variables should always be marked private." | |
severity: warning | |
environment_private: | |
name: "Private SwiftUI Environment" | |
regex: "\\@Environment.*\\)\\s*var" | |
message: "SwiftUI @Environment variables should always be marked private." | |
severity: warning | |
environment_private: | |
name: "Private SwiftUI ScaledMetric" | |
regex: "\\@ScaledMetric.*\\)\\s*var" | |
message: "SwiftUI @ScaledMetric variables should always be marked private." | |
severity: warning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
make some improvements