-
Notifications
You must be signed in to change notification settings - Fork 0
/
expo.js
209 lines (208 loc) · 5.84 KB
/
expo.js
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/** @type {import("eslint").Linter.Config} */
const expo = {
extends: [
'eslint:recommended',
'plugin:unicorn/recommended',
'universe',
'prettier'
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
plugins: ['eslint-plugin-tsdoc'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:unicorn/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: './',
project: ['./tsconfig.json']
},
rules: {
'@typescript-eslint/consistent-type-assertions': [
2,
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow-as-parameter'
}
],
'@typescript-eslint/consistent-type-exports': 2,
'@typescript-eslint/consistent-type-imports': 2,
'@typescript-eslint/explicit-function-return-type': 2,
'@typescript-eslint/explicit-module-boundary-types': 2,
'@typescript-eslint/member-ordering': 2,
'@typescript-eslint/method-signature-style': 2,
'@typescript-eslint/naming-convention': [
2,
{
selector: 'default',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'forbid'
},
{
selector: 'typeLike',
format: ['PascalCase']
},
{
selector: 'enumMember',
format: ['UPPER_CASE']
},
{
selector: 'variable',
types: ['boolean'],
format: ['camelCase', 'PascalCase'],
prefix: ['are', 'is', 'should', 'has', 'can', 'did', 'will', 'show']
}
],
'@typescript-eslint/no-confusing-void-expression': 2,
'@typescript-eslint/no-misused-promises': [
2,
{
checksVoidReturn: false
}
],
'@typescript-eslint/no-require-imports': 2,
'@typescript-eslint/no-unnecessary-condition': 2,
'@typescript-eslint/no-useless-empty-export': 2,
'@typescript-eslint/non-nullable-type-assertion-style': 0,
'@typescript-eslint/prefer-enum-initializers': 2,
'@typescript-eslint/sort-type-constituents': 2,
'@typescript-eslint/switch-exhaustiveness-check': 2,
'@typescript-eslint/type-annotation-spacing': 2,
'tsdoc/syntax': 2,
'unicorn/no-null': 0,
'unicorn/prevent-abbreviations': [
'error',
{
ignore: ['args', '.*Prop', 'ui.*', 'ref', 'params', 'prop']
}
]
}
}
],
plugins: ['@typescript-eslint'],
root: true,
rules: {
'accessor-pairs': 2,
'array-callback-return': 2,
'arrow-body-style': [2, 'as-needed'],
'block-scoped-var': 2,
camelcase: 2,
'class-methods-use-this': 2,
curly: [2, 'all'],
'default-case': 2,
'default-case-last': 2,
'dot-notation': 2,
eqeqeq: ['error', 'always', { null: 'ignore' }],
'grouped-accessor-pairs': 2,
'guard-for-in': 2,
'logical-assignment-operators': 2,
'no-alert': 1,
'no-array-constructor': 2,
'no-await-in-loop': 2,
'no-caller': 2,
'no-cond-assign': 2,
'no-console': 1,
'no-constant-binary-expression': 2,
'no-constructor-return': 2,
'no-duplicate-imports': 2,
'no-eval': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-global-assign': 2,
'no-implicit-coercion': 2,
'no-implicit-globals': 2,
'no-implied-eval': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-lone-blocks': 2,
'no-lonely-if': 2,
'no-loop-func': 2,
'no-multi-str': 2,
'no-nested-ternary': 2,
'no-new-func': 2,
'no-object-constructor': 2,
'no-new-wrappers': 2,
'no-octal-escape': 2,
'no-promise-executor-return': 2,
'no-proto': 2,
'no-script-url': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-template-curly-in-string': 2,
'no-throw-literal': 2,
'no-undef-init': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': 2,
'no-unreachable-loop': 2,
'no-unused-private-class-members': 2,
'no-use-before-define': 2,
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-concat': 2,
'no-useless-constructor': 2,
'no-useless-rename': 2,
'no-useless-return': 2,
'no-var': 2,
'no-void': 2,
'one-var': [2, 'never'],
'operator-assignment': [2, 'always'],
'prefer-arrow-callback': 2,
'prefer-const': 2,
'prefer-destructuring': 2,
'prefer-object-spread': 2,
'prefer-promise-reject-errors': 2,
'prefer-rest-params': 2,
'prefer-spread': 2,
'prefer-template': 2,
radix: 2,
'require-atomic-updates': 2,
'require-await': 2,
'sort-imports': [
2,
{
ignoreCase: true,
memberSyntaxSortOrder: ['all', 'multiple', 'single', 'none']
}
],
'symbol-description': 2,
'unicorn/no-negated-condition': 0,
'unicorn/no-null': 0,
'unicorn/prefer-ternary': [2, 'only-single-line'],
'unicorn/prevent-abbreviations': 0,
yoda: [2, 'never'],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function'
}
],
'react/hook-use-state': 2,
'react/no-array-index-key': 2,
'react/no-unstable-nested-components': 2,
'react/self-closing-comp': 2,
'react/jsx-boolean-value': [2, 'never'],
'react/jsx-fragments': 2,
'react/jsx-handler-names': [
2,
{
eventHandlerPrefix: 'on'
}
],
'react/jsx-no-useless-fragment': 2,
'react/jsx-pascal-case': 2,
'react/jsx-sort-props': [
2,
{
ignoreCase: true,
multiline: 'last'
}
],
'react/jsx-wrap-multilines': 2
}
}
module.exports = expo