Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 5bb4bf3

Browse files
feat: upgrade eslint-plugin-flowtype to 3.0.0
BREAKING CHANGE:
1 parent 30e94c2 commit 5bb4bf3

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

coding-styles/flow.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ module.exports = {
1414
],
1515

1616
rules: {
17+
// Enforces a particular annotation style of complex types
18+
'flowtype/array-style-complex-type': ['warn', 'shorthand'],
19+
20+
// Enforces a particular annotation style of simple types
21+
'flowtype/array-style-simple-type': ['warn', 'shorthand'],
22+
1723
// Enforces a particular style for boolean type annotations.
1824
'flowtype/boolean-style': ['warn', 'boolean'],
1925

@@ -27,6 +33,15 @@ module.exports = {
2733
// This rule takes one argument which mirrors ESLint's default comma-dangle rule.
2834
'flowtype/delimiter-dangle': ['warn', 'always-multiline'],
2935

36+
// Enforces a particular style for type imports
37+
'flowtype/type-import-style': ['warn', 'identifier'],
38+
39+
// This rule requires an empty line after the Flow annotation
40+
'flowtype/newline-after-flow-annotation': 'warn',
41+
42+
// Require all type declarations to be at the top of the file, after any import declarations
43+
'flowtype/require-types-at-top': 'warn',
44+
3045
// Enforces consistent use of semicolons after type aliases.
3146
'flowtype/semi': ['warn', 'never'],
3247

environments/flow/recommended.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ module.exports = {
2121
// Checks for duplicate properties in Object annotations.
2222
'flowtype/no-dupe-keys': 'error',
2323

24+
// Disallows use of the existential type (*)
25+
// https://flow.org/en/docs/types/utilities/#toc-existential-type
26+
'flowtype/no-existential-type': 'warn',
27+
28+
// Disallows $FlowFixMe comment suppressions
29+
// This is especially useful as a warning to ensure instances of $FlowFixMe in your codebase get
30+
// fixed over time.
31+
'flowtype/no-flow-fix-me-comments': 'warn',
32+
2433
// Disallows use of primitive constructors as types, such as Boolean, Number and String.
2534
'flowtype/no-primitive-constructor-types': 'error',
2635

@@ -37,7 +46,13 @@ module.exports = {
3746

3847
// Warns against weak type annotations any, Object and Function. These types can cause flow
3948
// to silently skip over portions of your code, which would have otherwise caused type errors.
40-
'flowtype/no-weak-types': ['warn', { any: true }],
49+
'flowtype/no-weak-types': ['warn', {
50+
any: true,
51+
}],
52+
53+
// This rule enforces exact object types
54+
// https://flow.org/en/docs/types/objects/#toc-exact-object-types
55+
'flowtype/require-exact-type': 'warn',
4156

4257
// Requires that all function parameters have type annotations.
4358
'flowtype/require-parameter-type': 'error',

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"Vladimir Vanek <[email protected]>"
1616
],
1717
"dependencies": {
18-
"eslint-plugin-flowtype": "^2.39.1",
18+
"eslint-plugin-flowtype": "^3.0.0",
1919
"eslint-plugin-import": "^2.14.0",
2020
"eslint-plugin-jsx-a11y": "^6.1.2",
2121
"eslint-plugin-mocha": "^5.2.0",

0 commit comments

Comments
 (0)