-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreact.mjs
32 lines (26 loc) · 805 Bytes
/
react.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
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,
{
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.
['^next', '^@next', '^@?\\w'], // Next.js related packages.
['^(~|@)(/.*|$)'], // Internal packages.
...COMMON_SORT_GROUPS,
],
},
],
},
},
reactHooks.configs['recommended-latest'],
]