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.
Problem
The project already enforces alphabetical ordering for metas via the
unsorted-metaslint. 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
bis declared beforea, which breaks alphabetical order.Suggestion
Add a new lint
unsorted-named-attributesthat reports aWARNINGlevel 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 bywrong-test-order.Expected fix
App.
[x] > app
x.mul 2 > a
x.plus 1 > b
This is consistent with
unsorted-metasand the general ordering philosophy of the project.