-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy path.eslintrc.js
More file actions
62 lines (60 loc) · 1.59 KB
/
Copy path.eslintrc.js
File metadata and controls
62 lines (60 loc) · 1.59 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
module.exports = {
root: true,
extends: '@react-native',
plugins: [
'react-native',
'react',
'react-hooks',
],
env: {
jest: true,
browser: true,
node: true,
es6: true,
},
rules: {
// TypeScript
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
// Code quality (built-in)
'no-empty': 'error',
'no-else-return': 'error',
'prefer-template': 'error',
complexity: ['error', 20],
'max-lines-per-function': ['error', 350],
'max-lines': ['error', 500],
'max-params': ['error', 3],
// React hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// React Native
'react-native/no-unused-styles': 'error',
'react-native/no-inline-styles': 'error',
'react-native/no-color-literals': 'error',
'react-native/no-raw-text': 'error',
'react-native/no-single-element-style-arrays': 'error',
},
overrides: [
{
// Relax structural rules in test files — large test suites and helpers are acceptable
files: ['__tests__/**/*', '*.test.ts', '*.test.tsx', 'jest.setup.ts'],
rules: {
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-params': 'off',
complexity: 'off',
'react-native/no-inline-styles': 'off',
'react-native/no-raw-text': 'off',
'react-native/no-color-literals': 'off',
},
},
],
};