-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
75 lines (67 loc) · 1.9 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
68
69
70
71
72
73
74
75
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import importPlugin from 'eslint-plugin-import';
import jsxA11Y from 'eslint-plugin-jsx-a11y';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import styledA11y from 'eslint-plugin-styled-components-a11y';
import testingLibrary from 'eslint-plugin-testing-library';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import storybook from 'eslint-plugin-storybook';
export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
jsxA11Y.flatConfigs.recommended,
styledA11y.flatConfigs.recommended,
testingLibrary.configs['flat/dom'],
...tseslint.configs.recommended,
...storybook.configs['flat/recommended'],
{
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
plugins: {
'react-refresh': reactRefresh,
'react-hooks': pluginReactHooks,
},
languageOptions: {
globals: {
...globals.browser,
},
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'react-refresh/only-export-components': 'warn',
'import/no-default-export': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
['sibling', 'parent'],
'index',
'object',
'type',
'unknown',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'testing-library/consistent-data-testid': [
'error',
{
testIdPattern: '^([a-z0-9]+-?:?)+$',
},
],
...pluginReactHooks.configs.recommended.rules,
},
},
];