-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
134 lines (134 loc) · 4.39 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
module.exports = {
extends: [
'next/core-web-vitals',
'airbnb-base',
'airbnb-typescript',
'plugin:unicorn/recommended',
'plugin:typescript-sort-keys/recommended',
],
parserOptions: {
project: './tsconfig.json',
},
env: {
jest: true,
node: true,
browser: true,
},
plugins: ['react', 'react-hooks', 'folders', 'sort-destructure-keys', 'json', 'unused-imports'],
overrides: [
{
files: ['*.js', '*.ts', '*.tsx'],
rules: {
'no-console': 'off',
'linebreak-style': 0,
'no-continue': 'off',
'consistent-return': 'off',
'prefer-arrow-callback': 2,
'operator-linebreak': 'off',
'no-confusing-arrow': 'off',
'no-underscore-dangle': 'off',
'object-curly-newline': 'off',
'no-restricted-syntax': 'off',
'no-prototype-builtins': 'off',
'class-methods-use-this': 'off',
'function-paren-newline': 'off',
'newline-per-chained-call': 'off',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' },
{ blankLine: 'always', prev: 'if', next: '*' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'function', next: 'function' },
],
'implicit-arrow-linebreak': 'off',
'import/order': 'off',
'import/no-cycle': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'react/no-this-in-sfc': 'off',
'react/jsx-curly-newline': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-curly-brace-presence': 'error',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'ignore',
},
],
'react/jsx-sort-props': [
2,
{
reservedFirst: true,
callbacksLast: true,
shorthandFirst: true,
},
],
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'error',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prefer-regexp-test': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-array-index-of': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
},
],
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['interface', 'type'],
next: '*',
},
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^[A-Z]',
match: true,
},
},
{
selector: 'enum',
format: ['PascalCase'],
custom: {
regex: '^[A-Z]',
match: true,
},
},
],
'sort-destructure-keys/sort-destructure-keys': [2, { caseSensitive: false }],
'folders/match-regex': [2, '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', `${process.cwd()}/`],
'unused-imports/no-unused-imports': 'error',
},
},
],
};