-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
.eslintrc.js
103 lines (103 loc) · 2.59 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
module.exports = {
env: {
es6: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jsdoc/recommended-error',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'unused-imports',
'import',
'functional',
'unicorn',
],
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/member-ordering': [
'error',
{
default: ['field', 'signature', 'constructor', 'method'],
},
],
'@typescript-eslint/method-signature-style': ['error', 'method'],
'@typescript-eslint/unbound-method': 'off',
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-handler-names': [
'error',
{
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
},
],
'unused-imports/no-unused-imports': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: { order: 'asc', caseInsensitive: true },
pathGroups: [
{
pattern: 'react**',
group: 'external',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'import/exports-last': 'error',
'functional/prefer-readonly-type': [
'error',
{
allowLocalMutation: true,
allowMutableReturnType: true,
ignoreClass: true,
},
],
'unicorn/no-null': 'error',
'require-await': 'off',
eqeqeq: 'error',
'no-empty-function': 'off',
semi: 'off',
complexity: 'error',
'max-depth': 'error',
},
settings: {
react: {
version: 'detect',
},
},
}