File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2203,6 +2203,10 @@ The following patterns are not considered problems:
2203
2203
` ` ` js
2204
2204
type foo = { foo: string, ... };
2205
2205
2206
+ interface Foo { foo: string }
2207
+
2208
+ declare class Foo { foo: string }
2209
+
2206
2210
type foo = {| | };
2207
2211
2208
2212
type foo = {| bar: string | };
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ const create = (context) => {
12
12
ObjectTypeAnnotation ( node ) {
13
13
const { inexact, exact} = node ;
14
14
15
+ if ( ! node . hasOwnProperty ( 'inexact' ) ) {
16
+ return ;
17
+ }
18
+
15
19
if ( always && ! inexact && ! exact ) {
16
20
context . report ( {
17
21
message : 'Type must be explicit inexact.' ,
Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ export default {
65
65
{
66
66
code : 'type foo = { foo: string, ... };'
67
67
} ,
68
+ {
69
+ code : 'interface Foo { foo: string }'
70
+ } ,
71
+ {
72
+ code : 'declare class Foo { foo: string }'
73
+ } ,
68
74
{
69
75
code : 'type foo = {| |};'
70
76
} ,
You can’t perform that action at this time.
0 commit comments