UNPKG

1.42 kBJavaScriptView Raw
1// @flow
2
3// See https://github.com/gajus/eslint-plugin-flowtype
4
5module.exports = {
6 extends: ['prettier/flowtype'],
7 plugins: ['flowtype'],
8 rules: {
9 // 'flowtype/no-primitive-constructor-types': 2,
10 // 'flowtype/require-parameter-type': [1, { excludeArrowFunctions: true }],
11 'flowtype/use-flow-type': 1,
12
13 // うーむ
14 // readonlyarrayは使いづらい
15 'flowtype/no-mutable-array': 0,
16 'flowtype/no-unused-expressions': 0,
17 'flowtype/no-weak-types': 1,
18
19 // 型が足りないときはflow自身が警告を出す
20 'require-parameter-type': 0,
21
22 // 基本的に推論させる
23 'flowtype/require-return-type': 0,
24
25 // 全ての宣言に型注釈が必要
26 'flowtype/require-variable-type': 0,
27 'flowtype/require-parameter-type': 0,
28
29 // Flow環境の場合、ほとんどの場合flow対象にする
30 'flowtype/require-valid-file-annotation': [1, 'always'],
31
32 // prettier
33 'flowtype/boolean-style': 0,
34
35 'flowtype/no-dupe-keys': 2,
36 'flowtype/define-flow-type': 2,
37 'flowtype/no-types-missing-file-annotation': 2,
38
39 'flowtype/no-primitive-constructor-types': 2,
40
41 'flowtype/type-id-match': 0,
42
43 // flowのコメントタイプのため
44 'spaced-comment': 0,
45
46 'flowtype/sort-keys': 0,
47
48 // FlowFixMeの抑制。使わざる得ない場面が多いあるので許可する
49 'flowtype/no-flow-fix-me-comments': 0,
50 },
51}