-
Notifications
You must be signed in to change notification settings - Fork 21
/
.eslintrc.js
116 lines (111 loc) · 2.78 KB
/
.eslintrc.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
module.exports = {
root: true,
extends: '@react-native',
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
globals: {
localStorage: false,
},
rules: {
'brace-style': [2, '1tbs', { allowSingleLine: true }],
// 'implicit-arrow-linebreak': [2, 'beside'],
indent: [
2,
'tab',
{ SwitchCase: 1, ignoredNodes: ['ConditionalExpression'] },
],
'no-async-promise-executor': 0,
'no-buffer-constructor': 0,
'no-case-declarations': 0,
'no-console': 0,
'no-empty': [2, { allowEmptyCatch: true }],
'no-promise-executor-return': 2,
'no-shadow': 0,
'no-undef': 0,
'no-useless-escape': 0,
'object-curly-spacing': [
2,
'always',
{
objectsInObjects: true,
},
],
'require-atomic-updates': 0,
semi: 2,
// TypeScript Plugin
// The following rules are made available via `@typescript-eslint/eslint-plugin`.
'@typescript-eslint/explicit-function-return-type': 2,
'@typescript-eslint/semi': 2,
// '@typescript-eslint/no-floating-promises': 2,
'@typescript-eslint/no-misused-promises': [
2,
{
checksVoidReturn: {
arguments: false,
attributes: false,
properties: false,
},
},
],
'@typescript-eslint/no-shadow': 2,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/prefer-optional-chain': 2,
// React Plugin
// The following rules are made available via `eslint-plugin-react`.
'react/default-props-match-prop-types': 2,
'react/jsx-equals-spacing': [2, 'never'],
'react/jsx-curly-spacing': [
2,
{
when: 'never',
attributes: { allowMultiline: true },
children: true,
},
],
'react/jsx-uses-vars': 2,
'react/jsx-wrap-multilines': 2,
'react/jsx-tag-spacing': [
2,
{
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'never',
},
],
'react/jsx-indent': [2, 'tab', { indentLogicalExpressions: false }],
'react/jsx-child-element-spacing': 2,
'react/no-unsafe': [2, { checkAliases: true }],
'react/no-unused-prop-types': 2,
'react/prop-types': 2,
// React-Native Plugin
// The following rules are made available via `eslint-plugin-react-native`
// 'react-native/no-color-literals': 2,
'react-native/no-single-element-style-arrays': 2,
'react-native/no-unused-styles': 2,
'react-native/no-raw-text': 0,
// Jest Plugin
// The following rules are made available via `eslint-plugin-jest`.
'jest/no-disabled-tests': 0,
'react-hooks/exhaustive-deps': [
'error',
{
additionalHooks: 'useDebouncedEffect',
},
],
// prettier
'no-mixed-spaces-and-tabs': 0,
},
overrides: [
// Disable type-aware linting for .js files
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/no-misused-promises': 0,
},
},
],
};