-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
83 lines (81 loc) · 1.92 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
const OFF = 0;
const WARN = 1;
const ERROR = 2;
/**
* @typedef {Object} ESLintRules
* @property {import('eslint/rules').ESLintRules} rules
* @typedef {import('eslint').Linter.Config&ESLintRules} ESLintConfig
*/
/**
* @type {ESLintConfig}
*/
module.exports = {
env: {
browser: true,
es6: true,
// es2021: true,
},
extends: [
'react-app',
'plugin:react/recommended',
'airbnb',
'plugin:prettier/recommended',
'prettier/react',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', 'react-hooks', '@babel', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
paths: ['./src'],
},
},
},
rules: {
'arrow-parens': [ERROR, 'as-needed'],
'default-case': [ERROR, { commentPattern: 'No Default' }],
'import/no-named-as-default': OFF,
'import/prefer-default-export': OFF,
'linebreak-style': [ERROR, 'windows'],
'max-len': [
ERROR,
{
ignorePattern: '^import .*',
ignoreComments: true,
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreTrailingComments: true,
ignoreTemplateLiterals: true,
},
], // *
'no-alert': WARN,
'no-console': OFF,
'no-continue': OFF,
'no-plusplus': OFF,
'no-tabs': OFF,
'no-underscore-dangle': OFF,
'react-hooks/exhaustive-deps': WARN, // Checks effect dependencies
'react-hooks/rules-of-hooks': ERROR, // Checks rules of Hooks
'react/jsx-filename-extension': [WARN, { extensions: ['.js', '.jsx'] }],
'react/jsx-indent': [ERROR, 'tab'],
'react/jsx-indent-props': [ERROR, 'tab'],
'react/jsx-props-no-spreading': OFF,
'react/no-array-index-key': OFF,
'prettier/prettier': ERROR,
'no-unused-expressions': OFF,
'@babel/no-unused-expressions': ERROR,
// These are alright for development
...(process.env.NODE_ENV !== 'production' && {
'react/prop-types': WARN,
'no-unused-vars': WARN,
'no-debugger': WARN,
}),
},
};