-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
60 lines (58 loc) · 1.71 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
// By default eslint ignore it's own config files, so:
// If making changes, lint with
// npx eslint .eslintrc.js --ignore-pattern '!.eslintrc.js'
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
parserOptions: {
ecmaVersion: '2019',
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
},
plugins: ['react', 'react-hooks'],
rules: {
'array-callback-return': 'warn',
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
'no-empty-function': 'warn',
'no-eval': 'warn',
'no-implied-eval': 'warn',
'no-invalid-this': 'error',
'no-param-reassign': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-self-compare': 'warn',
'no-useless-concat': 'warn',
'no-useless-return': 'warn',
'no-void': 'error',
'no-warning-comments': 'warn',
'no-with': 'error',
'prefer-promise-reject-errors': 'error',
'no-shadow-restricted-names': 'error',
'no-use-before-define': 'error',
'no-duplicate-imports': 'error',
'no-useless-rename': 'error',
'no-var': 'error',
'prefer-const': 'error',
'react/prop-types': ['error', { skipUndeclared: true }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// style rules
'semi': ['error', 'always'],
'wrap-iife': ['warn', 'inside'],
'space-before-function-paren': 'warn',
'no-trailing-spaces': 'error',
'quotes': ['warn', 'single'],
'arrow-spacing': 'warn',
},
// Notes about React plugin custom settings: https://github.com/yannickcr/eslint-plugin-react#configuration
'settings': {
'react': {
'version': 'detect',
},
},
};