-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
47 lines (46 loc) · 1.24 KB
/
eslint.config.mjs
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
import pluginJs from '@eslint/js'
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'
import importSort from 'eslint-plugin-simple-import-sort'
import globals from 'globals'
import tseslint from 'typescript-eslint'
const needCheckFiles = [
'packages/docs/src/**/*.ts',
'packages/docs/src/**/*.tsx',
'packages/docs/src/**/*.js',
'packages/component/src/**/*.ts',
'packages/component/src/**/*.tsx',
'packages/component/src/**/*.js',
]
/** @type {Array<import("eslint").Linter.Config>} */
export default [
{
languageOptions: {
globals: globals.browser,
},
},
{
...pluginJs.configs.recommended,
files: needCheckFiles,
},
...tseslint.configs.recommended?.map((i) => ({
...i,
files: needCheckFiles,
})),
{ ...pluginReactConfig, files: needCheckFiles },
{
plugins: {
[`simple-import-sort`]: importSort,
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-useless-escape': 'off',
'react/display-name': 'off',
'no-console': 'error',
'simple-import-sort/imports': 'error',
},
files: needCheckFiles,
},
]