-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreact.mjs
More file actions
33 lines (27 loc) · 806 Bytes
/
react.mjs
File metadata and controls
33 lines (27 loc) · 806 Bytes
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
import reactPlugin from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import { COMMON_SORT_GROUPS, JAVASCRIPT_FILES, TYPESCRIPT_FILES } from '../constants.mjs'
import jsx from './jsx.mjs'
export default [
...jsx,
{
name: 'prefer-code-style/react/config',
files: [...JAVASCRIPT_FILES, ...TYPESCRIPT_FILES],
...reactPlugin.configs.flat.recommended,
...reactPlugin.configs.flat['jsx-runtime'],
rules: {
'simple-import-sort/imports': [
1,
{
groups: [
['^react'], // React related packages come first.
['^@?\\w'],
['^(~|@)(/.*|$)'], // Internal packages.
...COMMON_SORT_GROUPS,
],
},
],
},
},
reactHooks.configs.flat['recommended-latest'],
]