-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy patheslint.config.js
More file actions
102 lines (97 loc) · 2.69 KB
/
eslint.config.js
File metadata and controls
102 lines (97 loc) · 2.69 KB
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
const prettier = require('eslint-plugin-prettier');
const react = require('eslint-plugin-react');
const reactHooks = require('eslint-plugin-react-hooks');
const js = require('@eslint/js');
const globals = require('globals');
const babelParser = require('@babel/eslint-parser');
module.exports = [
js.configs.recommended,
{
ignores: [
'src/library/*',
'src/pages/calendar/modules/calendarControl/**',
'src/pages/integration/svgIcon.js',
'src/pages/workflow/api/*',
'src/pages/workflow/apiV2/*',
'src/pages/Statistics/api/*',
'src/pages/integration/api/*',
'src/pages/widgetConfig/widgetSetting/components/DevelopWithAI/examples/**',
'src/components/Mingo/ChatBot/components/Recorder/lib.js',
'src/pages/widgetConfig/widgetSetting/components/FunctionEditorDialog/Func/lib/**',
'src/pages/widgetConfig/widgetSetting/components/FunctionEditorDialog/Func/test/**',
],
},
{
files: ['**/*.js', '**/*.jsx'],
plugins: {
react,
'react-hooks': reactHooks,
prettier,
},
languageOptions: {
parser: babelParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
File: false,
_l: false,
delCookie: false,
getCookie: false,
md: false,
setCookie: false,
wx: false,
safeParse: false,
safeLocalStorageSetItem: false,
getCurrentLang: false,
translations: false,
__api_server__: false,
$: false,
createTimeSpan: false,
getCurrentLangCode: false,
jQuery: false,
IM: false,
dd: false,
mdyAPI: false,
AMap: false,
destroyAlert: false,
blobStream: false,
moxie: false,
plupload: false,
ActiveXObject: false,
HWH5: false,
WeixinJSBridge: false,
google: false,
TencentCaptcha: false,
VConsole: false,
},
},
rules: {
// React rules
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/react-in-jsx-scope': 'error',
// React Hooks rules
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
// Prettier integration
'prettier/prettier': 'error',
'no-extra-boolean-cast': 'warn',
'no-async-promise-executor': 'off',
'no-loss-of-precision': 'off',
'no-case-declarations': 'off',
'no-control-regex': 'off',
'no-useless-escape': 'off',
'no-prototype-builtins': 'off',
},
settings: {
react: {
version: 'detect',
},
},
},
];