···
1
1
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2
2
-
import storybook from "eslint-plugin-storybook";
2
2
+
import storybook from 'eslint-plugin-storybook';
3
3
4
4
import js from '@eslint/js';
5
5
import prettierPlugin from 'eslint-plugin-prettier';
6
6
import tseslint from '@typescript-eslint/eslint-plugin';
7
7
import tsparser from '@typescript-eslint/parser';
8
8
9
9
-
export default [js.configs.recommended, {
10
10
-
ignores: [
11
11
-
'src/webapp/**',
12
12
-
'dist/**',
13
13
-
'node_modules/**',
14
14
-
'src/modules/atproto/infrastructure/lexicon/**',
15
15
-
'src/webapp/next-env.d.ts',
16
16
-
],
17
17
-
}, {
18
18
-
files: ['**/*.js'],
19
19
-
languageOptions: {
20
20
-
ecmaVersion: 2022,
21
21
-
sourceType: 'script',
22
22
-
globals: {
23
23
-
console: 'readonly',
24
24
-
process: 'readonly',
25
25
-
Buffer: 'readonly',
26
26
-
__dirname: 'readonly',
27
27
-
__filename: 'readonly',
28
28
-
module: 'readonly',
29
29
-
require: 'readonly',
30
30
-
exports: 'readonly',
31
31
-
global: 'readonly',
32
32
-
setTimeout: 'readonly',
9
9
+
export default [
10
10
+
js.configs.recommended,
11
11
+
{
12
12
+
ignores: [
13
13
+
'src/webapp/**',
14
14
+
'dist/**',
15
15
+
'node_modules/**',
16
16
+
'src/modules/atproto/infrastructure/lexicon/**',
17
17
+
'src/webapp/next-env.d.ts',
18
18
+
],
19
19
+
},
20
20
+
{
21
21
+
files: ['**/*.js'],
22
22
+
languageOptions: {
23
23
+
ecmaVersion: 2022,
24
24
+
sourceType: 'script',
25
25
+
globals: {
26
26
+
console: 'readonly',
27
27
+
process: 'readonly',
28
28
+
Buffer: 'readonly',
29
29
+
__dirname: 'readonly',
30
30
+
__filename: 'readonly',
31
31
+
module: 'readonly',
32
32
+
require: 'readonly',
33
33
+
exports: 'readonly',
34
34
+
global: 'readonly',
35
35
+
setTimeout: 'readonly',
36
36
+
},
37
37
+
},
38
38
+
plugins: {
39
39
+
prettier: prettierPlugin,
40
40
+
},
41
41
+
rules: {
42
42
+
'prettier/prettier': 'error',
43
43
+
'no-unused-vars': 'warn',
44
44
+
'no-console': 'warn',
33
45
},
34
46
},
35
35
-
plugins: {
36
36
-
prettier: prettierPlugin,
47
47
+
{
48
48
+
files: ['**/*.ts'],
49
49
+
plugins: {
50
50
+
'@typescript-eslint': tseslint,
51
51
+
prettier: prettierPlugin,
52
52
+
},
53
53
+
languageOptions: {
54
54
+
parser: tsparser,
55
55
+
ecmaVersion: 2022,
56
56
+
sourceType: 'module',
57
57
+
globals: {
58
58
+
console: 'readonly',
59
59
+
process: 'readonly',
60
60
+
Buffer: 'readonly',
61
61
+
__dirname: 'readonly',
62
62
+
__filename: 'readonly',
63
63
+
module: 'readonly',
64
64
+
require: 'readonly',
65
65
+
exports: 'readonly',
66
66
+
global: 'readonly',
67
67
+
fetch: 'readonly',
68
68
+
// Jest globals
69
69
+
describe: 'readonly',
70
70
+
test: 'readonly',
71
71
+
it: 'readonly',
72
72
+
expect: 'readonly',
73
73
+
beforeAll: 'readonly',
74
74
+
beforeEach: 'readonly',
75
75
+
afterAll: 'readonly',
76
76
+
afterEach: 'readonly',
77
77
+
jest: 'readonly',
78
78
+
URLSearchParams: 'readonly',
79
79
+
setTimeout: 'readonly',
80
80
+
NodeJS: 'readonly',
81
81
+
clearTimeout: 'readonly',
82
82
+
setImmediate: 'readonly',
83
83
+
setInterval: 'readonly',
84
84
+
clearInterval: 'readonly',
85
85
+
URL: 'readonly',
86
86
+
},
87
87
+
},
88
88
+
rules: {
89
89
+
'prettier/prettier': 'error',
90
90
+
'no-unused-vars': 'off', // Turn off base rule
91
91
+
'@typescript-eslint/no-unused-vars': 'warn',
92
92
+
'no-console': 'warn',
93
93
+
},
37
94
},
38
38
-
rules: {
39
39
-
'prettier/prettier': 'error',
40
40
-
'no-unused-vars': 'warn',
41
41
-
'no-console': 'warn',
42
42
-
},
43
43
-
}, {
44
44
-
files: ['**/*.ts'],
45
45
-
plugins: {
46
46
-
'@typescript-eslint': tseslint,
47
47
-
prettier: prettierPlugin,
48
48
-
},
49
49
-
languageOptions: {
50
50
-
parser: tsparser,
51
51
-
ecmaVersion: 2022,
52
52
-
sourceType: 'module',
53
53
-
globals: {
54
54
-
console: 'readonly',
55
55
-
process: 'readonly',
56
56
-
Buffer: 'readonly',
57
57
-
__dirname: 'readonly',
58
58
-
__filename: 'readonly',
59
59
-
module: 'readonly',
60
60
-
require: 'readonly',
61
61
-
exports: 'readonly',
62
62
-
global: 'readonly',
63
63
-
fetch: 'readonly',
64
64
-
// Jest globals
65
65
-
describe: 'readonly',
66
66
-
test: 'readonly',
67
67
-
it: 'readonly',
68
68
-
expect: 'readonly',
69
69
-
beforeAll: 'readonly',
70
70
-
beforeEach: 'readonly',
71
71
-
afterAll: 'readonly',
72
72
-
afterEach: 'readonly',
73
73
-
jest: 'readonly',
74
74
-
URLSearchParams: 'readonly',
75
75
-
setTimeout: 'readonly',
76
76
-
NodeJS: 'readonly',
77
77
-
clearTimeout: 'readonly',
78
78
-
setImmediate: 'readonly',
79
79
-
setInterval: 'readonly',
80
80
-
clearInterval: 'readonly',
81
81
-
URL: 'readonly',
95
95
+
{
96
96
+
files: ['**/*.test.ts', '**/*.spec.ts'],
97
97
+
languageOptions: {
98
98
+
parser: tsparser,
99
99
+
ecmaVersion: 2022,
100
100
+
sourceType: 'module',
101
101
+
globals: {
102
102
+
console: 'readonly',
103
103
+
process: 'readonly',
104
104
+
Buffer: 'readonly',
105
105
+
__dirname: 'readonly',
106
106
+
__filename: 'readonly',
107
107
+
module: 'readonly',
108
108
+
require: 'readonly',
109
109
+
exports: 'readonly',
110
110
+
global: 'readonly',
111
111
+
fetch: 'readonly',
112
112
+
// Jest globals
113
113
+
describe: 'readonly',
114
114
+
test: 'readonly',
115
115
+
it: 'readonly',
116
116
+
expect: 'readonly',
117
117
+
beforeAll: 'readonly',
118
118
+
beforeEach: 'readonly',
119
119
+
afterAll: 'readonly',
120
120
+
afterEach: 'readonly',
121
121
+
jest: 'readonly',
122
122
+
// Browser globals for e2e tests using Playwright
123
123
+
document: 'readonly',
124
124
+
window: 'readonly',
125
125
+
navigator: 'readonly',
126
126
+
location: 'readonly',
127
127
+
setTimeout: 'readonly',
128
128
+
NodeJS: 'readonly',
129
129
+
clearTimeout: 'readonly',
130
130
+
},
131
131
+
},
132
132
+
plugins: {
133
133
+
'@typescript-eslint': tseslint,
134
134
+
prettier: prettierPlugin,
82
135
},
83
83
-
},
84
84
-
rules: {
85
85
-
'prettier/prettier': 'error',
86
86
-
'no-unused-vars': 'off', // Turn off base rule
87
87
-
'@typescript-eslint/no-unused-vars': 'warn',
88
88
-
'no-console': 'warn',
89
89
-
},
90
90
-
}, {
91
91
-
files: ['**/*.test.ts', '**/*.spec.ts'],
92
92
-
languageOptions: {
93
93
-
parser: tsparser,
94
94
-
ecmaVersion: 2022,
95
95
-
sourceType: 'module',
96
96
-
globals: {
97
97
-
console: 'readonly',
98
98
-
process: 'readonly',
99
99
-
Buffer: 'readonly',
100
100
-
__dirname: 'readonly',
101
101
-
__filename: 'readonly',
102
102
-
module: 'readonly',
103
103
-
require: 'readonly',
104
104
-
exports: 'readonly',
105
105
-
global: 'readonly',
106
106
-
fetch: 'readonly',
107
107
-
// Jest globals
108
108
-
describe: 'readonly',
109
109
-
test: 'readonly',
110
110
-
it: 'readonly',
111
111
-
expect: 'readonly',
112
112
-
beforeAll: 'readonly',
113
113
-
beforeEach: 'readonly',
114
114
-
afterAll: 'readonly',
115
115
-
afterEach: 'readonly',
116
116
-
jest: 'readonly',
117
117
-
// Browser globals for e2e tests using Playwright
118
118
-
document: 'readonly',
119
119
-
window: 'readonly',
120
120
-
navigator: 'readonly',
121
121
-
location: 'readonly',
122
122
-
setTimeout: 'readonly',
123
123
-
NodeJS: 'readonly',
124
124
-
clearTimeout: 'readonly',
136
136
+
rules: {
137
137
+
'prettier/prettier': 'error',
138
138
+
'no-unused-vars': 'off',
139
139
+
'@typescript-eslint/no-unused-vars': 'warn',
140
140
+
'no-console': 'warn',
125
141
},
126
142
},
127
127
-
plugins: {
128
128
-
'@typescript-eslint': tseslint,
129
129
-
prettier: prettierPlugin,
130
130
-
},
131
131
-
rules: {
132
132
-
'prettier/prettier': 'error',
133
133
-
'no-unused-vars': 'off',
134
134
-
'@typescript-eslint/no-unused-vars': 'warn',
135
135
-
'no-console': 'warn',
136
136
-
},
137
137
-
}, ...storybook.configs["flat/recommended"]];
143
143
+
...storybook.configs['flat/recommended'],
144
144
+
];
···
64
64
65
65
decorators: [
66
66
(Story, context) => {
67
67
-
const colorScheme = (context.globals.colorScheme as 'light' | 'dark') ?? 'light';
67
67
+
const colorScheme =
68
68
+
(context.globals.colorScheme as 'light' | 'dark') ?? 'light';
68
69
return (
69
70
<QueryClientProvider client={queryClient}>
70
71
<MantineProvider