-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
105 lines (105 loc) · 2.14 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
99
100
101
102
103
104
105
/** @type {import('eslint').Linter.Config} */
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
],
ignorePatterns: ['node_modules', 'package-lock.json', '/dist'],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'import',
'jsx-a11y',
'node',
'prefer-arrow',
'react',
'react-hooks',
],
root: true,
rules: {
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'separate-type-imports',
},
],
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
curly: ['error', 'all'],
'import/order': [
'error',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
},
],
'no-console': [
'error',
{
allow: ['error', 'warn', 'info'],
},
],
'prefer-arrow-callback': [
'error',
{
allowNamedFunctions: false,
allowUnboundThis: false,
},
],
'prefer-arrow/prefer-arrow-functions': [
'error',
{
allowStandaloneDeclarations: false,
classPropertiesAllowed: false,
disallowPrototype: true,
singleReturnOnly: true,
},
],
'prefer-const': ['error'],
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
reservedFirst: true,
},
],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
};