-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
82 lines (80 loc) · 2.4 KB
/
.eslintrc.js
File metadata and controls
82 lines (80 loc) · 2.4 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
module.exports = {
root: true,
extends: [
'@react-native',
'plugin:prettier/recommended', // Ensure Prettier rules are applied
],
plugins: ['simple-import-sort', 'import', 'prettier'],
rules: {
// Prettier Integration
'prettier/prettier': [
'error',
{
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: true,
singleQuote: true,
trailingComma: 'all',
},
],
// Core Rules
'react-hooks/exhaustive-deps': 'off',
quotes: ['error', 'single'],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'react/default-props-match-prop-types': 'error',
'react/sort-prop-types': 'error',
'prefer-template': 'error',
'react/react-in-jsx-scope': 'off',
'no-duplicate-imports': 'error',
'react-hooks/rules-of-hooks': 'error',
'no-constant-binary-expression': 'error',
'no-await-in-loop': 'error',
'prefer-arrow-callback': ['error', { allowUnboundThis: false }],
'prefer-const': 'error',
'prefer-destructuring': 'warn',
'prefer-spread': 'warn',
'no-self-compare': 'error',
'no-template-curly-in-string': 'warn',
'dot-notation': 'error',
eqeqeq: 'error',
'no-alert': 'error',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-else-return': 'error',
'no-nested-ternary': 'error',
'no-var': 'error',
'require-await': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages `react` related packages come first.
['^react', '^@?\\w'],
// Internal packages.
['^(@|components)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.?(css)$'],
],
},
],
// Formatting Rules
'no-trailing-spaces': 'error',
'newline-before-return': 'error',
'eol-last': ['error', 'always'],
indent: ['error', 2, { SwitchCase: 1 }],
},
settings: {
react: {
version: 'detect',
},
},
};