-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
115 lines (113 loc) · 3.22 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
'airbnb',
'plugin:react/jsx-runtime',
],
ignorePatterns: ['dist', 'node_modules', 'build', 'public', 'assets'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'react-refresh',
'@typescript-eslint',
'unused-imports',
'simple-import-sort',
'prettier',
'unicorn',
'@stylistic/eslint-plugin-js',
'react',
'react-hooks',
],
rules: {
eqeqeq: 'error',
'@typescript-eslint/no-floating-promises': [
'error',
{
ignoreIIFE: true,
},
],
'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before' } }],
'no-console': 'warn',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-shadow': 'off',
'implicit-arrow-linebreak': 'off',
'arrow-body-style': 'off',
'object-curly-newline': [
'error',
{
ObjectExpression: { consistent: true, multiline: true },
ObjectPattern: { consistent: true, multiline: true },
ImportDeclaration: { consistent: true, multiline: true },
ExportDeclaration: { consistent: true, multiline: true },
},
],
'import/prefer-default-export': 'off',
'import/no-unresolved': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-shadow': ['error'],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.ts', '.tsx', '.jsx'] }],
'react/jsx-one-expression-per-line': [1, { allow: 'single-child' }],
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': [1, { ignoreFunctionalComponents: true }],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'jsx-a11y/label-has-associated-control': [
2,
{
labelComponents: ['CustomInputLabel'],
labelAttributes: ['label'],
controlComponents: ['CustomInput'],
depth: 3,
},
],
},
settings: {
'import/resolver': {
typescript: {},
},
},
noInlineConfig: true,
};