forked from gajus/eslint-plugin-flowtype
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
115 lines (112 loc) · 4.51 KB
/
index.js
File metadata and controls
115 lines (112 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import _ from 'lodash';
import recommended from './configs/recommended.json';
import arrayStyleComplexType from './rules/arrayStyleComplexType';
import arrayStyleSimpleType from './rules/arrayStyleSimpleType';
import booleanStyle from './rules/booleanStyle';
import defineFlowType from './rules/defineFlowType';
import delimiterDangle from './rules/delimiterDangle';
import genericSpacing from './rules/genericSpacing';
import newlineAfterFlowAnnotation from './rules/newlineAfterFlowAnnotation';
import noDupeKeys from './rules/noDupeKeys';
import noExistentialType from './rules/noExistentialType';
import noFlowFixMeComments from './rules/noFlowFixMeComments';
import noMutableArray from './rules/noMutableArray';
import noPrimitiveConstructorTypes from './rules/noPrimitiveConstructorTypes';
import noTypesMissingFileAnnotation from './rules/noTypesMissingFileAnnotation';
import noUnusedExpressions from './rules/noUnusedExpressions';
import noWeakTypes from './rules/noWeakTypes';
import objectTypeDelimiter from './rules/objectTypeDelimiter';
import requireCompoundTypeAlias from './rules/requireCompoundTypeAlias';
import requireExactType from './rules/requireExactType';
import requireParameterType from './rules/requireParameterType';
import requireReturnType from './rules/requireReturnType';
import requireTypesAtTop from './rules/requireTypesAtTop';
import requireValidFileAnnotation from './rules/requireValidFileAnnotation';
import requireVariableType from './rules/requireVariableType';
import semi from './rules/semi';
import sortKeys from './rules/sortKeys';
import spaceAfterTypeColon from './rules/spaceAfterTypeColon';
import spaceBeforeGenericBracket from './rules/spaceBeforeGenericBracket';
import spaceBeforeTypeColon from './rules/spaceBeforeTypeColon';
import typeIdMatch from './rules/typeIdMatch';
import typeImportStyle from './rules/typeImportStyle';
import unionIntersectionSpacing from './rules/unionIntersectionSpacing';
import useFlowType from './rules/useFlowType';
import validSyntax from './rules/validSyntax';
import {checkFlowFileAnnotation} from './utilities';
const rules = {
'array-style-complex-type': arrayStyleComplexType,
'array-style-simple-type': arrayStyleSimpleType,
'boolean-style': booleanStyle,
'define-flow-type': defineFlowType,
'delimiter-dangle': delimiterDangle,
'generic-spacing': genericSpacing,
'newline-after-flow-annotation': newlineAfterFlowAnnotation,
'no-dupe-keys': noDupeKeys,
'no-existential-type': noExistentialType,
'no-flow-fix-me-comments': noFlowFixMeComments,
'no-mutable-array': noMutableArray,
'no-primitive-constructor-types': noPrimitiveConstructorTypes,
'no-types-missing-file-annotation': noTypesMissingFileAnnotation,
'no-unused-expressions': noUnusedExpressions,
'no-weak-types': noWeakTypes,
'object-type-delimiter': objectTypeDelimiter,
'require-compound-type-alias': requireCompoundTypeAlias,
'require-exact-type': requireExactType,
'require-parameter-type': requireParameterType,
'require-return-type': requireReturnType,
'require-types-at-top': requireTypesAtTop,
'require-valid-file-annotation': requireValidFileAnnotation,
'require-variable-type': requireVariableType,
semi,
'sort-keys': sortKeys,
'space-after-type-colon': spaceAfterTypeColon,
'space-before-generic-bracket': spaceBeforeGenericBracket,
'space-before-type-colon': spaceBeforeTypeColon,
'type-id-match': typeIdMatch,
'type-import-style': typeImportStyle,
'union-intersection-spacing': unionIntersectionSpacing,
'use-flow-type': useFlowType,
'valid-syntax': validSyntax
};
export default {
configs: {
recommended
},
rules: _.mapValues(rules, (rule, key) => {
if (key === 'no-types-missing-file-annotation') {
return rule;
}
return {
...rule,
create: _.partial(checkFlowFileAnnotation, rule.create)
};
}),
rulesConfig: {
'boolean-style': 0,
'define-flow-type': 0,
'delimiter-dangle': 0,
'generic-spacing': 0,
'newline-after-flow-annotation': 0,
'no-dupe-keys': 0,
'no-flow-fix-me-comments': 0,
'no-mutable-array': 0,
'no-weak-types': 0,
'object-type-delimiter': 0,
'require-compound-type-alias': 0,
'require-exact-type': 0,
'require-parameter-type': 0,
'require-return-type': 0,
'require-variable-type': 0,
semi: 0,
'sort-keys': 0,
'space-after-type-colon': 0,
'space-before-generic-bracket': 0,
'space-before-type-colon': 0,
'type-id-match': 0,
'type-import-style': 0,
'union-intersection-spacing': 0,
'use-flow-type': 0,
'valid-syntax': 0
}
};