-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
70 lines (70 loc) · 1.86 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
module.exports = {
globals: {
self: 'readonly',
},
extends: [
'react-app',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
],
plugins: [
'prettier',
'unused-imports',
'@typescript-eslint',
'simple-import-sort',
],
parser: '@typescript-eslint/parser',
root: true,
parserOptions: { project: './tsconfig.json' },
rules: {
'react-hooks/rules-of-hooks': 'error',
'import/no-duplicates': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'simple-import-sort/imports': [
'error',
{
groups: [
// React and Electron packages first, then other third-party packages.
['^react', '^electron', '^@?\\w'],
// Holium packages.
['^@holium'],
// Aliased internal packages.
[
'^(background|main|os|renderer|components|util|blocks|general|input|navigation|hooks|analysers|connection|helpers|peer)(/.*|$)',
],
// Relative imports.
['^\\.'],
// Style imports.
['^.+\\.?(css)$'],
],
},
],
'simple-import-sort/exports': 'error',
// Disabled rules
'react-hooks/exhaustive-deps': 'off',
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
settings: {
react: {
version: 'detect',
},
},
};