-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
155 lines (155 loc) · 4.58 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
module.exports = {
extends: [
'eslint:recommended',
'next',
'next/core-web-vitals',
'plugin:jest-dom/recommended',
'plugin:cypress/recommended',
'plugin:prettier/recommended',
],
globals: {
__static: true,
cy: true,
},
plugins: ['prettier', 'jest-dom'],
rules: {
'prettier/prettier': 'error',
'max-len': [
2,
{
code: 120,
ignoreComments: true,
ignoreUrls: true,
},
],
'@next/next/no-img-element': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'react/jsx-fragments': 'off',
'react/prop-types': 'off',
'react/require-default-props': 'off',
'react/jsx-first-prop-new-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-indent': 'off',
'react/jsx-indent-props': 'off',
'react/display-name': 1,
'react/prefer-stateless-function': 0,
'react/state-in-constructor': 0,
'react/jsx-curly-newline': 0,
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
'jsx-a11y/accessible-emoji': 0,
'jsx-a11y/anchor-is-valid': [
'warn',
{
aspects: ['invalidHref'],
},
],
'import/extensions': 'off',
'comma-dangle': 0,
'no-underscore-dangle': 'off',
'one-var': 'off',
'no-return-assign': 'off',
'no-use-before-define': 'off',
'class-methods-use-this': 'off',
'import/no-named-as-default-member': 'off',
'object-curly-spacing': [2, 'always'],
semi: ['error', 'always'],
'no-unused-vars': [
1,
{
ignoreRestSiblings: true,
argsIgnorePattern: 'res|next|^err|^_',
},
],
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
'no-unused-expressions': [
2,
{
allowTaggedTemplates: true,
},
],
'no-param-reassign': [
2,
{
props: false,
},
],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'multiline-const', next: '*' },
{ blankLine: 'always', prev: 'function', next: '*' },
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'no-console': 0,
'import/prefer-default-export': 0,
'import/no-extraneous-dependencies': 0,
'consistent-return': 0,
curly: [2, 'multi-line'],
'arrow-body-style': [2, 'as-needed'],
camelcase: 0,
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
quotes: [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
},
overrides: [
{
files: '**/*.+(ts|tsx)',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
},
],
};