-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
114 lines (86 loc) · 2.14 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import { configs, defineConfig, presets } from '@tabula/eslint-config';
export default defineConfig({
build: {
ignores: ['**/lib/**', '**/typings/**', 'eslint.config.mjs', 'plopfile.js'],
},
javascript: {
files: ['storybook/**/*.js'],
configs: presets.javascript(),
},
typescriptBrowser: {
files: ['{components,hooks,libraries}/*/{src,stories,tests}/**/*.{ts,tsx}'],
configs: presets.typescript({
language: {
globals: ['browser'],
},
importX: {
react: true,
typescript: {
alwaysTryTypes: true,
project: [
'components/*/tsconfig.json',
'hooks/*/tsconfig.json',
'libraries/*/tsconfig.json',
],
},
},
typescript: {
useTyped: true,
parserOptions: {
projectService: true,
},
},
}),
},
typescriptNode: {
files: ['configs/*/{src,tests}/**/*.ts'],
configs: presets.typescript({
language: {
globals: ['node'],
},
importX: {
typescript: {
alwaysTryTypes: true,
project: ['configs/*/tsconfig.json'],
},
},
typescript: {
useTyped: true,
parserOptions: {
projectService: true,
},
},
}),
},
react: {
files: ['{components,hooks}/*/{src,stories,tests}/**/*.tsx'],
configs: presets.react(),
},
reactHooks: {
files: ['{components,hooks}/*/{src,tests}/**/*.{ts,tsx}'],
configs: configs.reactHooks(),
},
testingLibrary: {
files: ['{components,hooks,libraries}/*/tests/*.{ts,tsx}'],
configs: configs.testingLibrary({ library: 'react' }),
},
vitest: {
files: ['{components,configs,hooks,libraries}/*/tests/*.{ts,tsx}'],
configs: configs.vitest(),
},
overridesStories: {
files: ['{components,hooks}/*/stories/*.tsx'],
rules: {
'react/no-multi-comp': 'off',
},
},
overridesTests: {
files: [
'components/{ui-checkbox-tree,ui-tree}/tests/*.test.{ts,tsx}',
'libraries/tree-utils/tests/*.test.ts',
],
rules: {
'vitest/expect-expect': 'off',
},
},
});