-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy path.eslintrc.js
More file actions
141 lines (141 loc) · 3.34 KB
/
.eslintrc.js
File metadata and controls
141 lines (141 loc) · 3.34 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
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
module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js', '.native.js', '.ios.tsx', '.android.tsx']
},
typescript: {
project: './tsconfig.json'
}
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
react: {
version: 'detect'
}
},
parser: '@babel/eslint-parser',
extends: [
'@rocket.chat/eslint-config',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'prettier'
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2024
},
plugins: ['import', 'react-native', '@babel'],
env: {
es6: true
},
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'warning',
jsx: 'warning',
ts: 'warning',
tsx: 'warning'
}
],
'import/named': 'error',
'import/no-cycle': 'error',
'import/no-unresolved': 'error',
'import/order': [
'error',
{
'newlines-between': 'ignore'
}
],
'react/display-name': 'off',
'react/jsx-fragments': ['error', 'syntax'],
'react/jsx-key': 'off',
'react/no-direct-mutation-state': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/immutability': 'warn',
'react-hooks/refs': 'warn',
'react-native/no-color-literals': 'off',
'react-native/no-inline-styles': 'off',
'react-native/no-raw-text': 'off',
'react-native/no-single-element-style-arrays': 'error',
'react-native/no-unused-styles': 'error',
'react-native/split-platform-components': 'off',
'no-unused-vars': 'off',
'no-void': 'error',
'new-cap': 'error',
'require-await': 'error'
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'@rocket.chat/eslint-config',
'plugin:prettier/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'inline-type-imports'
}
],
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-var-requires': 'off',
'no-return-assign': 'off',
'no-dupe-class-members': 'off',
'no-extra-parens': 'off',
'no-spaced-func': 'off',
'no-unused-vars': 'off',
'no-useless-constructor': 'off',
'no-use-before-define': 'off',
'new-cap': 'off',
'lines-between-class-members': 'off'
},
globals: {
JSX: 'readonly'
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx']
}
}
}
},
{
files: ['jest.setup.js', '__mocks__/**/*.js', '**/*.test.{js,ts,tsx}'],
extends: ['plugin:jest/recommended']
},
{
files: ['index.js', 'app/**/*.{js,ts,tsx}'],
env: {
'react-native/react-native': true
}
}
]
};