-
-
Notifications
You must be signed in to change notification settings - Fork 521
/
.eslintrc.js
113 lines (107 loc) · 3.01 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
module.exports = {
extends: [
'standard',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react/recommended',
'prettier',
],
plugins: ['react-native', 'react-hooks'],
env: {
'react-native/react-native': true,
},
settings: {
'import/core-modules': [
'react-native-screens',
'react-native-screens/native-stack',
'react-native-screens/reanimated',
'react-native-screens/gesture-handler',
],
'import/ignore': [
'node_modules/react-native/index\\.js$',
'react-native/Libraries/Utilities/codegenNativeComponent.*',
'react-native/Libraries/Types/CodegenTypes.*',
],
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.native.js'],
},
},
react: {
version: 'detect',
},
},
rules: {
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
overrides: [
{
files: ['*.{js,jsx}'],
parser: 'babel-eslint',
},
{
files: ['*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as' },
],
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-empty-interface': [
'error',
{ allowSingleExtends: true },
],
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
classes: false,
variables: false,
typedefs: false,
},
],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/unified-signatures': 'error',
'default-case': 'off',
'no-unused-vars': 'off',
'no-array-constructor': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
'ts-expect-error': 'allow-with-description',
},
],
},
},
],
};