-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
92 lines (89 loc) · 2.18 KB
/
eslint.config.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
import globals from 'globals'
import js from '@eslint/js'
import importPlugin from 'eslint-plugin-import'
import reactPlugin from 'eslint-plugin-react'
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
export default [
js.configs.recommended,
reactRecommended,
{
files: ['**/*.{js,jsx}'],
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: { reactPlugin, import: importPlugin },
settings: {
'import/extensions': ['.js', '.jsx'],
'import/resolver': {
node: true,
},
'import/parsers': {
espree: ['.js', '.jsx'],
},
react: {
version: 'detect',
},
},
rules: {
...importPlugin.configs.recommended.rules,
'no-unused-vars': 0,
'import/no-unresolved': 0,
'import/no-named-as-default': 0,
'import/no-named-as-default-member': 0,
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'sibling'],
pathGroups: [
{
pattern: 'react*',
group: 'builtin',
},
{
pattern: '~/**',
group: 'internal',
},
],
},
],
'react/display-name': 0,
'react/prop-types': 0,
'react/no-direct-mutation-state': 0,
'react/require-render-return': 0,
'react/jsx-no-undef': 0,
'react/jsx-uses-react': 0,
'react/jsx-uses-vars': 0,
'react/react-in-jsx-scope': 0,
'react/no-danger-with-children': 0,
'sort-imports': [
'error',
{
allowSeparatedGroups: true,
ignoreCase: true,
ignoreDeclarationSort: true, // use import-sort instead
memberSyntaxSortOrder: ['all', 'single', 'multiple', 'none'],
},
],
},
},
{
ignores: [
// config files
'*.config.js',
// server
'dev.js',
// bundles
'public/*.bundle.js',
// development
'**/*.hot-update.js*',
],
},
]