-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
67 lines (66 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
import stylistic from '@stylistic/eslint-plugin';
import parserTs from '@typescript-eslint/parser';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
import reactHooks from 'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js';
import js from '@eslint/js';
import globals from 'globals';
export default [
/* Browser environment */
{
languageOptions: {
globals: {
...globals.browser,
},
},
},
/* Default flat configs */
{
...reactRecommended,
...reactJsxRuntime,
...js.configs.recommended,
},
/* React hooks config */
{
plugins: { 'react-hooks': reactHooks }, // react hooks' config are not yet flat config ready
rules: reactHooks.configs.recommended.rules,
},
/* Stylistic flat config factory */
{
...stylistic.configs.customize({
semi: true,
quotes: 'single',
arrowParens: true,
braceStyle: '1tbs',
}),
languageOptions: {
parser: parserTs,
},
files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx'],
},
/* Stylistic overrides */
{
plugins: { stylistic },
languageOptions: {
parser: parserTs,
},
files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx'],
rules: {
'@stylistic/jsx-closing-bracket-location': 'off', // makes writing with clsx cleaner
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'comma',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
multilineDetection: 'brackets',
},
],
},
},
];