-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
54 lines (53 loc) · 1.39 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReact from 'eslint-plugin-react'
import stylistic from '@stylistic/eslint-plugin'
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
stylistic.configs.customize({
semi: false,
}),
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
},
},
},
{
rules: {
'@stylistic/function-call-spacing': 'error',
'@stylistic/brace-style': [
'error',
'1tbs',
{ allowSingleLine: true },
],
'@stylistic/jsx-one-expression-per-line': 'off',
'@stylistic/object-curly-newline': [
'error',
{
multiline: true,
consistent: true,
minProperties: 5,
},
],
'@stylistic/array-element-newline': [
'error',
{
ArrayExpression: 'consistent',
ArrayPattern: { minItems: 3 },
},
],
'@stylistic/jsx-quotes': ['error', 'prefer-single'],
'@stylistic/space-before-function-paren': ['error', 'always'],
'react/react-in-jsx-scope': 'off',
},
},
]