-
Notifications
You must be signed in to change notification settings - Fork 106
/
eslint.config.mjs
49 lines (47 loc) · 1.12 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
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import nextPlugin from '@next/eslint-plugin-next'
import stylistic from '@stylistic/eslint-plugin'
import react from '@eslint-react/eslint-plugin'
import { fixupPluginRules } from '@eslint/compat'
import globals from 'globals'
const config = tseslint.config(
{
files: ['src/**/*.ts', 'src/*.tsx'],
ignores: ['node_modules', 'dist', '.next'],
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
},
},
eslint.configs.recommended,
...tseslint.configs.recommended,
react.configs.recommended,
stylistic.configs.customize({
indent: 2,
quotes: 'single',
jsx: true,
semi: false,
}),
{
settings: {
react: {
version: 'detect',
},
},
plugins: {
'@next/next': fixupPluginRules(nextPlugin),
stylistic,
react,
},
rules: {
// Next.js
...nextPlugin.configs.recommended.rules,
'@next/next/no-img-element': 'off',
'stylistic/no-multiple-empty-lines': ['error', { max: 1 }],
},
},
)
export default config