Skip to content

SwiftLint 'attributes' rule flags property wrappers #365

Closed
@trozware

Description

@trozware

The SwiftLint 'attributes' rule states "Attributes should be on their own lines in functions and types, but on the same line as variables and imports"

But it flags property wrapper lines like these with warnings, even though they are not functions or types:

@AppStorage("editorFontSize") var editorFontSize: Double = 14
@SceneStorage("windowTheme") var windowTheme = "dark"
@Environment(\.dismiss) var dismiss

I have opened an issue at SwiftLint for this: realm/SwiftLint#5129 but until it is fixed, it would probably be better to remove this opt-in rule from the default yaml file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions