@@ -1131,7 +1131,7 @@ import Foo from './foo';
11311131// Message: Expected newline after flow annotation
11321132
11331133// Options: ["always-windows"]
1134- // @flow
1134+ // @flow
11351135import Foo from ' ./foo' ;
11361136// Message: Expected newline after flow annotation
11371137
@@ -1151,8 +1151,8 @@ The following patterns are not considered problems:
11511151import Foo from ' ./foo' ;
11521152
11531153// Options: ["always-windows"]
1154- // @flow
1155-
1154+ // @flow
1155+
11561156import Foo from ' ./foo' ;
11571157
11581158// Options: ["never"]
@@ -1568,19 +1568,20 @@ The following patterns are not considered problems:
15681568<a name="eslint-plugin-flowtype-rules-no-weak-types"></a>
15691569### <code>no-weak-types</code>
15701570
1571- Warns against weak type annotations *any*, *Object* and *Function*.
1571+ Warns against weak type annotations *any*, *mixed*, * Object* and *Function*.
15721572These types can cause flow to silently skip over portions of your code,
15731573which would have otherwise caused type errors.
15741574
15751575This rule optionally takes one argument, an object to configure which type warnings to enable. By default, all of the
15761576warnings are enabled. e.g. to disable the ` any` warning (allowing it to exist in your code), while continuing to warn
1577- about ` Object ` and ` Function ` :
1577+ about ` mixed ` , ` Object ` and ` Function ` :
15781578
15791579` ` ` js
15801580{
15811581 " rules" : {
15821582 " flowtype/no-weak-types" : [2 , {
15831583 " any" : false ,
1584+ " mixed: true,
15841585 " Object " : true,
15851586 " Function " : true
15861587 }]
@@ -1610,6 +1611,15 @@ function foo(thing): Promise<any> {}
16101611function foo(thing): Promise<Promise<any>> {}
16111612// Message: Unexpected use of weak type " any"
16121613
1614+ function foo(thing): mixed {}
1615+ // Message: Unexpected use of weak type " mixed"
1616+
1617+ function foo(thing): Promise<mixed> {}
1618+ // Message: Unexpected use of weak type " mixed"
1619+
1620+ function foo(thing): Promise<Promise<mixed>> {}
1621+ // Message: Unexpected use of weak type " mixed"
1622+
16131623function foo(thing): Object {}
16141624// Message: Unexpected use of weak type " Object "
16151625
@@ -1732,6 +1742,9 @@ class Foo { props: string }
17321742// Options: [{" Object " :false," any" :false}]
17331743type X = any; type Y = Object
17341744
1745+ // Options: [{" Object " :false," mixed" :false}]
1746+ type X = mixed; type Y = Object
1747+
17351748// Options: [{" Function " :false}]
17361749type X = Function
17371750
@@ -3411,7 +3424,7 @@ The following patterns are not considered problems:
34113424 { a: string, b: number }) => {}
34123425
34133426// Options: ["always",{"allowLineBreak":true}]
3414- (foo:
3427+ (foo:
34153428 { a: string, b: number }) => {}
34163429
34173430// Options: ["never"]
0 commit comments