-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
106 lines (105 loc) · 2.56 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
const path = require('path');
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'airbnb-typescript'
],
rules: {
'consistent-return': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
varsIgnorePattern: '_',
argsIgnorePattern: '_',
}],
'react/jsx-props-no-spreading': 'off',
'import/prefer-default-export': 'off',
'import/first': 'error',
'import/order': ['error', {
'groups': [
['builtin', 'external'], 'internal', 'parent', 'sibling', 'index'
],
'pathGroups': [
{
'pattern': 'react',
'group': 'external',
'position': 'before'
}
],
'pathGroupsExcludedImportTypes': ['react'],
'newlines-between': 'always',
'alphabetize': {
'order': 'asc',
'caseInsensitive': true
}
}],
'sort-imports': ['error', {
'ignoreCase': true,
'ignoreDeclarationSort': true,
'ignoreMemberSort': false,
}],
'jsx-quotes': ['error', 'prefer-single'],
'object-curly-newline': ['error', {
'ObjectExpression': { 'multiline': true },
'ObjectPattern': { 'multiline': true },
'ImportDeclaration': { 'multiline': true, 'minProperties': 4 },
'ExportDeclaration': { 'multiline': true, 'minProperties': 4 }
}],
'@typescript-eslint/type-annotation-spacing': 'error',
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-no-duplicate-props': ['error', { 'ignoreCase': false }],
/*
'jsx-a11y/label-has-associated-control': [ 2, {
'labelComponents': ['CustomInputLabel'],
'labelAttributes': ['label'],
'controlComponents': ['CustomInput'],
'depth': 3,
}],
*/
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: [path.resolve(__dirname, './tsconfig.json'), path.resolve(__dirname, './electron/tsconfig.json')],
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
paths: [path.resolve(__dirname, 'src')],
},
},
'import/core-modules': ['electron'],
},
plugins: [
'react',
'@typescript-eslint',
'import',
'react-hooks'
],
overrides: [
{
files: [
'**/*.test.ts',
'**/*.test.tsx',
],
env: {
jest: true,
},
},
]
};