-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy patheslint.config.mjs
65 lines (63 loc) · 1.63 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import stylistic from '@stylistic/eslint-plugin'
import react from '@eslint-react/eslint-plugin'
import globals from 'globals'
import nextPlugin from '@next/eslint-plugin-next'
import { fixupPluginRules } from '@eslint/compat'
const baseConfig = tseslint.config(
{
files: ['*/src/**.{ts,tsx,js,mjs}', 'scripts/*.mjs', '*/*.mjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals['shared-node-browser'],
},
},
},
{
ignores: ['docs/node_modules', 'docs/.next', '**/*.cjs', '**/*.js', '*/dist'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
react.configs.recommended,
react.configs.dom,
stylistic.configs.customize({
indent: 2,
quotes: 'single',
jsx: true,
semi: false,
}),
{
settings: {
'react-x': { version: 'detect' },
},
plugins: { 'react-x': react, stylistic },
rules: {
'@eslint-react/dom/no-missing-button-type': 'off',
'stylistic/no-multiple-empty-lines': ['error', { max: 1 }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/consistent-type-imports': 'error',
'@eslint-react/no-duplicate-key': 'warn',
},
},
{
files: ['docs/src/**/*.{ts,tsx}'],
settings: {
next: {
rootDir: 'docs',
},
},
plugins: {
'@next/next': fixupPluginRules(nextPlugin),
},
rules: {
// Next.js
...nextPlugin.configs.recommended.rules,
'@next/next/no-img-element': 'off',
},
},
)
export default baseConfig