-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
67 lines (61 loc) · 1.82 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
66
67
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'
import { fixupConfigRules } from '@eslint/compat'
import reactCompiler from 'eslint-plugin-react-compiler'
export default [
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
plugins: { 'react-compiler': reactCompiler },
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...fixupConfigRules(pluginReactConfig),
{
settings: {
react: {
version: 'detect',
},
},
},
{
ignores: ['.next/', 'src-tauri/', 'out'],
},
{
rules: {
'react-compiler/react-compiler': 'error',
'react/react-in-jsx-scope': 'off',
semi: ['error', 'never'],
quotes: ['error', 'single'],
'no-var': 'warn',
'prefer-const': 'warn',
'indent-legacy': ['error', 2],
'comma-dangle': ['error', 'always-multiline'],
'comma-style': ['error', 'last'],
'array-bracket-newline': ['error', 'consistent'],
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'react/prop-types': 'off',
'space-in-parens': ['error', 'never'],
'quote-props': ['error', 'as-needed'],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'function', next: '*' },
],
},
},
]