You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .README/rules/delimiter-dangle.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@ _The `--fix` option on the command line automatically fixes problems reported by
4
4
5
5
Enforces consistent use of trailing commas in Object and Tuple annotations.
6
6
7
-
This rule takes one argument which mirrors ESLint's default `comma-dangle` rule.
7
+
This rule takes two arguments which both mirror ESLint's default `comma-dangle` rule.
8
+
The first argument is for Object and Tuple annotations.
9
+
The second argument is used for Interface annotations as ESLint's default `comma-dangle` doesn't apply to interfaces - this defaults to whatever the first argument is.
8
10
9
11
If it is `'never'` then a problem is raised when there is a trailing comma.
Copy file name to clipboardExpand all lines: README.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -604,7 +604,9 @@ _The `--fix` option on the command line automatically fixes problems reported by
604
604
605
605
Enforces consistent use of trailing commas in Object and Tuple annotations.
606
606
607
-
This rule takes one argument which mirrors ESLint's default `comma-dangle` rule.
607
+
This rule takes two arguments which both mirror ESLint's default `comma-dangle` rule.
608
+
The first argument is for Object and Tuple annotations.
609
+
The second argument is used for Interface annotations as ESLint's default `comma-dangle` doesn't apply to interfaces - this defaults to whatever the first argument is.
608
610
609
611
If it is `'never'` then a problem is raised when there is a trailing comma.
610
612
@@ -660,6 +662,10 @@ foo: string
660
662
type X= { foo: string; }
661
663
// Message: Unexpected trailing delimiter
662
664
665
+
// Options: ["always","never"]
666
+
interfaceX { foo: string; }
667
+
// Message: Unexpected trailing delimiter
668
+
663
669
// Options: ["never"]
664
670
type X= { [key: string]: number, }
665
671
// Message: Unexpected trailing delimiter
@@ -862,6 +868,9 @@ type X = {
862
868
foo: string;
863
869
}
864
870
871
+
// Options: ["never","always"]
872
+
interfaceX { foo: string; }
873
+
865
874
// Options: ["never"]
866
875
type X= {}
867
876
@@ -1152,7 +1161,7 @@ import Foo from './foo';
1152
1161
// Message: Expected newline after flow annotation
1153
1162
1154
1163
// Options: ["always-windows"]
1155
-
// @flow
1164
+
// @flow
1156
1165
importFoofrom'./foo';
1157
1166
// Message: Expected newline after flow annotation
1158
1167
@@ -1172,8 +1181,8 @@ The following patterns are not considered problems:
1172
1181
importFoofrom'./foo';
1173
1182
1174
1183
// Options: ["always-windows"]
1175
-
// @flow
1176
-
1184
+
// @flow
1185
+
1177
1186
importFoofrom'./foo';
1178
1187
1179
1188
// Options: ["never"]
@@ -4028,7 +4037,7 @@ The following patterns are not considered problems:
0 commit comments