-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
104 lines (104 loc) · 2.66 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
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'@react-native-community',
'plugin:prettier/recommended',
'prettier',
'expo',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: '2020',
sourceType: 'module',
},
plugins: ['react-refresh', '@typescript-eslint', 'prettier', 'import'],
rules: {
'import/default': 'off',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'import/no-unresolved': 'error',
'no-duplicate-imports': 'error',
'no-confusing-arrow': 'error',
'no-else-return': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-semi': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
curly: 'error',
'default-case': 'error',
'no-nested-ternary': 'error',
'arrow-body-style': ['error', 'as-needed'],
'default-param-last': 'error',
'prefer-const': 'error',
'no-return-await': 'error',
'prefer-arrow-callback': 'error',
'no-var': 'error',
'no-undef-init': 'error',
'no-useless-return': 'error',
'no-return-assign': 'error',
'require-await': 'error',
'no-lonely-if': 'error',
eqeqeq: ['error', 'always'],
'react-refresh/only-export-components': 'warn',
/**
* @deprecated here because it's cause unneeded error
*/
'@typescript-eslint/ban-types': 'off',
'prefer-destructuring': [
'warn',
{
array: true,
object: true,
},
{
enforceForRenamedProperties: false,
},
],
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index', 'unknown'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
};