-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
92 lines (90 loc) · 1.95 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
const path = require('path');
const srcPath = path.resolve(__dirname, 'src');
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'prettier',
],
plugins: ['simple-import-sort', 'prettier'],
settings: {
'import/resolver': {
alias: {
map: [
['@', srcPath],
['@static', `${srcPath}/../static`],
],
extensions: ['.js', '.jsx'],
},
node: {
paths: [srcPath],
extensions: ['.js', '.jsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'arrow-parens': 0,
'no-debugger': 1,
'no-warning-comments': [
1,
{
terms: ['hardcoded'],
location: 'anywhere',
},
],
'no-return-await': 0,
'object-curly-spacing': ['error', 'always'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-var': 'error',
'comma-dangle': [1, 'always-multiline'],
'linebreak-style': ['error', 'unix'],
'max-len': [
1,
{
code: 80,
comments: 80,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-console': [
1,
{
allow: ['warn', 'error'],
},
],
'react/display-name': 'off',
'react/prop-types': 'off',
'import/namespace': 'off',
'react-hooks/exhaustive-deps': 'off',
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
'error',
{
li: ['link'],
},
],
},
};