-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
73 lines (73 loc) · 2.5 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
module.exports = {
root: true,
plugins: ['@typescript-eslint', 'import', 'simple-import-sort', 'prettier'],
extends: [
'eslint:recommended',
'@react-native-community',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-var-requires': 'error',
},
},
],
ignorePatterns: ['node_modules/'],
rules: {
// code readibility
complexity: ['error', 25], // https://eslint.org/docs/rules/complexity
'max-nested-callbacks': ['error', 4], // https://eslint.org/docs/rules/max-nested-callbacks
'max-params': ['error', 5], // https://eslint.org/docs/rules/max-params
'max-depth': ['error', 3], // https://eslint.org/docs/rules/max-depth
'max-len': ['error', 200], // https://eslint.org/docs/rules/max-len
'max-lines': ['error', 300], // https://eslint.org/docs/rules/max-lines
'max-statements': ['error', 10], // https://eslint.org/docs/rules/max-statements
'max-lines-per-function': ['error', 50], //https://eslint.org/docs/rules/max-lines-per-function
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
'object-shorthand': ['error', 'always'],
'no-useless-concat': 'error',
'prefer-template': 'error',
'no-mixed-operators': [
'error',
{
groups: [
['+', '-', '%', '&&', '||'],
['*', '/', '%', '&&', '||'],
],
},
],
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'prettier/prettier': 'error',
radix: ['error', 'as-needed'],
'simple-import-sort/imports': [
'error',
{
groups: [
['^\\u0000'], // Side effect imports.
['^react', '^@?\\w'], // Packages, packages starting "react" first
['^'], // Absolute imports
['^\\.\\.(?!/?$)', '^\\.\\./?$'], // Parent imports. Put `..` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], // Other relative imports. Put same-folder imports and `.` last.
['^\\./styled'], // Styled
],
},
],
'simple-import-sort/exports': 'error',
'react-hooks/exhaustive-deps': [
'error',
{
additionalHooks: '(useAccessibilityActions)',
},
],
'@typescript-eslint/no-var-requires': 'off',
},
};