-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy patheslint.config.mjs
50 lines (48 loc) · 1.27 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
48
49
50
import importPlugin from 'eslint-plugin-import'
import prettierPluginRecomended from 'eslint-plugin-prettier/recommended'
import reactPlugin from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import sonarjsPlugin from 'eslint-plugin-sonarjs'
import globals from 'globals'
import eslintJs from '@eslint/js'
import eslintTs from 'typescript-eslint' // eslint-disable-line import/no-unresolved
const config = eslintTs.config(
eslintJs.configs.recommended,
...eslintTs.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
reactPlugin.configs.flat.recommended,
{
plugins: {
'react-hooks': reactHooksPlugin,
},
rules: {
'react/react-in-jsx-scope': 'off',
...reactHooksPlugin.configs.recommended.rules,
},
},
sonarjsPlugin.configs.recommended,
prettierPluginRecomended,
{
ignores: ['node_modules/', 'dist/'],
},
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
...globals.mocha,
...globals.es2021,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
},
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
}
)
export default config