-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patheslint.config.js
More file actions
75 lines (69 loc) · 1.81 KB
/
Copy patheslint.config.js
File metadata and controls
75 lines (69 loc) · 1.81 KB
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
68
69
70
71
72
73
74
75
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 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: false,
quotes: 'single',
arrowParens: true,
braceStyle: '1tbs',
}),
languageOptions: {
parser: parserTs,
},
files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx'],
},
/* Stylistic overrides */
{
plugins: { '@stylistic': 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',
},
],
},
},
/* Ignore build folders */
{
ignores: ['ts-out/*', 'build/*', 'node_modules/*'],
},
]