Skip to content

Unsorted named attributes inside formation not detected by lint #1001

Description

@ext11n7

Problem

The project already enforces alphabetical ordering for metas via the unsorted-metas lint. However, there is no lint that checks whether named inner objects (attributes) inside a formation are listed in alphabetical order. Inconsistent ordering makes code harder to navigate and review.

Example of bad code

App.
[x] > app

x.plus 1 > b

x.mul 2 > a

Here b is declared before a, which breaks alphabetical order.

Suggestion

Add a new lint unsorted-named-attributes that reports a WARNING level defect when named inner objects inside a formation are not listed in alphabetical order. Exceptions: @ (phi) should always remain first, and test objects (marked with +) should keep their own order as governed by wrong-test-order.

Expected fix

App.
[x] > app

x.mul 2 > a

x.plus 1 > b

This is consistent with unsorted-metas and the general ordering philosophy of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersgood-titleThe title was checked and improved by ChatGPThelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions