-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
58 lines (53 loc) · 1.57 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
import eslint from '@eslint/js'
import prettier from 'eslint-config-prettier'
import storybook from 'eslint-plugin-storybook'
import svelte from 'eslint-plugin-svelte'
import globals from 'globals'
import svelteParser from 'svelte-eslint-parser'
import tseslint from 'typescript-eslint'
/* eslint-disable @typescript-eslint/no-unsafe-member-access,
@typescript-eslint/no-unsafe-assignment */
export default tseslint.config(
{
files: ['.js', '.mjs', '.mts', '.svelte', '.ts'].flatMap(e => [`**/*${e}`, `*${e}`]),
extends: [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
prettier,
],
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parser: tseslint.parser,
parserOptions: { extraFileExtensions: ['.svelte'], project: './tsconfig.eslint.json' },
},
},
{
extends: [...svelte.configs['flat/recommended'], ...svelte.configs['flat/prettier']],
files: ['.svelte'].flatMap(e => [`**/*${e}`, `*${e}`]),
languageOptions: {
globals: globals.browser,
parser: svelteParser,
parserOptions: { parser: tseslint.parser, project: './tsconfig.eslint.json' },
},
},
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
extends: storybook.configs.recommended.overrides.map(o => ({ files: o.files, rules: o.rules })),
plugins: { storybook },
},
{
ignores: [
'.pnpm-store',
'.storybook',
'.svelte-kit',
'build',
'dist',
'node_modules',
'package',
'storybook-static',
'vite.config.js.timestamp-*',
'vite.config.ts.timestamp-*',
],
},
)