-
Notifications
You must be signed in to change notification settings - Fork 19
/
eslint.config.js
30 lines (29 loc) · 1.12 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
import eslint from '@eslint/js'
import a11y from 'eslint-plugin-jsx-a11y'
import react from 'eslint-plugin-react'
import hooks from 'eslint-plugin-react-hooks'
import sort from 'eslint-plugin-simple-import-sort'
import tseslint from 'typescript-eslint'
export default tseslint.config(
eslint.configs.recommended,
a11y.flatConfigs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
...tseslint.configs.recommendedTypeChecked,
{
settings: { react: { version: 'detect' } },
languageOptions: { parserOptions: { project: true, tsconfigRootDir: import.meta.dirname } },
linterOptions: { reportUnusedDisableDirectives: 'off' },
plugins: { 'react-hooks': hooks, 'simple-import-sort': sort },
// @ts-expect-error pending package update
rules: {
...hooks.configs.recommended.rules,
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': [
'warn',
{ groups: [['^\\u0000'], ['^node:'], ['^(react|solid|vite)', '^@?\\w'], ['^'], ['^\\.']] },
],
},
},
{ files: ['!src/**/*.{ts,tsx}'], extends: [tseslint.configs.disableTypeChecked] },
)