-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
98 lines (98 loc) · 2.21 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
module.exports = {
plugins: ['prettier'],
extends: [
'airbnb-typescript',
'airbnb/hooks',
'prettier',
'prettier/react',
'plugin:unicorn/recommended',
],
rules: {
'import/no-namespace': 'error',
'import/no-relative-parent-imports': 'error',
'import/no-anonymous-default-export': [
'error',
{
allowArray: true,
allowArrowFunction: false,
allowAnonymousClass: false,
allowAnonymousFunction: false,
allowCallExpression: true, // The true value here is for backward compatibility
allowLiteral: true,
allowObject: true,
},
],
'import/order': [
'error',
{
pathGroups: [
{
pattern: 'consts/**',
group: 'external',
position: 'after',
},
{
pattern: 'components/**',
group: 'external',
position: 'after',
},
{
pattern: 'helpers/**',
group: 'external',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/forbid-dom-props': ['error', { forbid: ['style'] }],
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
'unicorn/filename-case': [
'error',
{
case: 'camelCase',
ignore: ['App.tsx'],
},
],
},
parserOptions: {
project: './tsconfig.json',
},
overrides: [
{
files: ['src/components/**/*.tsx'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'pascalCase',
},
],
},
},
{
files: ['src/pages/**/*.tsx'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
},
],
},
},
],
};