Skip to content

Commit 313935c

Browse files
committed
feat: create flowtype config
1 parent 2c159f3 commit 313935c

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

flowtype.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
plugins: ['flowtype'],
4+
extends: ['plugin:flowtype/recommended', 'prettier/flowtype'],
5+
rules: {
6+
'flowtype/array-style-complex-type': ['error', 'verbose'],
7+
'flowtype/array-style-simple-type': ['error', 'shorthand'],
8+
'flowtype/arrow-parens': ['error', 'as-needed'],
9+
'flowtype/define-flow-type': 'error',
10+
'flowtype/newline-after-flow-annotation': 'error',
11+
'flowtype/no-dupe-keys': 'error',
12+
'flowtype/no-existential-type': 'error',
13+
'flowtype/no-flow-fix-me-comments': 'error',
14+
'flowtype/no-mixed': 'warn',
15+
'flowtype/no-primitive-constructor-types': 'error',
16+
'flowtype/no-unused-expressions': 'error',
17+
'flowtype/no-weak-types': 'error',
18+
'flowtype/require-compound-type-alias': 'warn',
19+
'flowtype/require-exact-type': 'warn',
20+
'flowtype/require-indexer-name': ['error', 'always'],
21+
'flowtype/require-inexact-type': 'error',
22+
'flowtype/require-parameter-type': 'error',
23+
'flowtype/require-readonly-react-props': 'error',
24+
'flowtype/require-return-type': [
25+
'warn',
26+
'always',
27+
{ excludeArrowFunctions: true }
28+
],
29+
'flowtype/require-types-at-top': 'warn',
30+
'flowtype/require-valid-file-annotation': [
31+
'error',
32+
'always',
33+
{ annotationStyle: 'line', strict: true }
34+
],
35+
'flowtype/spread-exact-type': 'error',
36+
'flowtype/type-import-style': ['error', 'declaration']
37+
}
38+
};

package-lock.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"license": "ISC",
1111
"author": "Gareth Jones",
1212
"files": [
13+
"flowtype.js",
1314
"index.js",
1415
"jest.js"
1516
],
@@ -55,8 +56,10 @@
5556
"@typescript-eslint/eslint-plugin": "^2.16.0",
5657
"@typescript-eslint/experimental-utils": "^2.16.0",
5758
"@typescript-eslint/parser": "^2.16.0",
59+
"babel-eslint": "^10.0.3",
5860
"eslint": "^6.8.0",
5961
"eslint-plugin-eslint-comments": "^3.1.2",
62+
"eslint-plugin-flowtype": "^4.6.0",
6063
"eslint-plugin-jest": "^23.4.0",
6164
"eslint-plugin-local": "^1.0.0",
6265
"eslint-plugin-prettier": "^3.1.2",

0 commit comments

Comments
 (0)