forked from palantir/tslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
member-ordering: Add 'alphabetize' option (palantir#2101)
- Loading branch information
1 parent
9f8fd27
commit d7c2bde
Showing
3 changed files
with
106 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class X { | ||
// Different categories have alphabetization together. | ||
bar: number; | ||
foo: string; | ||
|
||
[Symbol.iterator]() {} | ||
// No ordering among computed properties | ||
[Symbol.alpherator]() {} | ||
|
||
0() {} | ||
2() {} | ||
1() {} | ||
~ ['1' should come alphabetically before '2'] | ||
|
||
foo() {} | ||
"goo"() {} | ||
Hoo() {} | ||
ioo() {} | ||
bar() {} | ||
~~~ ['bar' should come alphabetically before 'foo'] | ||
|
||
// Computed properties must go at the beginning. | ||
[Symbol.zeterator]() {} | ||
~~~~~~~~~~~~~~~~~~ [Computed property should come alphabetically before '0'] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"rules": { | ||
"member-ordering": [true, { | ||
"order": "fields-first", | ||
"alphabetize": true | ||
}] | ||
} | ||
} |