generated from coryhouse/react-slingshot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
103 lines (98 loc) · 2.08 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 = {
root: true,
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:no-unsanitized/DOM',
'prettier',
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
moduleDirectory: ['node_modules', 'src/'],
},
},
},
plugins: [
'react',
'simple-import-sort',
'sort-keys-fix',
'sort-destructure-keys',
'import',
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
},
},
env: {
es6: true,
browser: true,
node: true,
jquery: true,
jest: true,
},
rules: {
// Do not allow dangerously setting innerHTML
'react/no-danger': 'error',
'react/no-danger-with-children': 'error',
// Do not allow alert
'no-alert': 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
// Not turned on by default
'no-unused-expressions': 'off',
// Not turned on by default
'no-use-before-define': 'off',
'react-hooks/exhaustive-deps': 'error',
// Sorting imports
'simple-import-sort/imports': [
'error',
{
groups: [
['^\\u0000'],
['^react', '^prop-types'],
['^@material-ui'],
['^assets'],
['^@?\\w'],
['^[^.]'],
['^\\.'],
],
},
],
'simple-import-sort/exports': 'error',
'sort-imports': 'off',
// Sort props and keys
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
shorthandFirst: true,
ignoreCase: true,
noSortAlphabetically: false,
reservedFirst: true,
},
],
'sort-keys-fix/sort-keys-fix': [
'error',
'asc',
{
natural: true,
},
],
'sort-destructure-keys/sort-destructure-keys': [
'error',
{ caseSensitive: false },
],
},
globals: {},
}