-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
76 lines (76 loc) · 2.45 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
module.exports = {
root: true,
env: { browser: true,
es2021: true,
commonjs: true },
globals: { Atomics: 'readonly',
SharedArrayBuffer: 'readonly' },
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
ecmaFeatures: { jsx: true },
ecmaVersion: 8,
sourceType: 'module',
babelOptions: { presets: [
[
'@babel/preset-env',
{ targets: { browsers: ['Chrome >= 88'] }, loose: true },
],
['@babel/preset-react', { runtime: 'automatic' }],
],
plugins: [
'@babel/plugin-transform-runtime',
['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }],
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
// "@babel/plugin-transform-regenerator",
] },
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:jsx-a11y/recommended',
'airbnb',
// 'react-app',
'plugin:es/no-new-in-esnext',
],
plugins: ['babel', 'react', 'react-hooks', 'jsx-a11y', 'import', 'promise', 'es'],
rules: {
semi: ['error', 'never'],
indent: ['error', 2, { SwitchCase: 1 }],
allowImplicit: 0,
camelcase: 'error',
'template-curly-spacing': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/destructuring-assignment': 0,
'arrow-parens': 0,
'react/prop-types': 0,
'max-len': ['error', { code: 350 }],
'linebreak-style': ['error', 'unix'],
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'no-continue': 'off',
'object-curly-newline': [
'error',
{
// ImportDeclaration: 'never',
// ExportDeclaration: 'never',
// ObjectPattern: { multiline: false },
consistent: true,
minProperties: 7,
// ObjectExpression: { multiline: true },
},
],
'array-callback-return': 'off',
'consistent-return': 'off',
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
'no-use-before-define': 'off',
allowShortCircuit: 0,
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'react/function-component-definition': 0,
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsForRegex: ['(d|D)raft'] }],
'es/no-string-prototype-replaceall': ['error', { aggressive: true }],
},
}