-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.mjs
72 lines (71 loc) · 1.94 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
import eslint from '@eslint/js';
import prettier from 'eslint-config-prettier';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import eslintPluginPromise from 'eslint-plugin-promise';
import tseslint from 'typescript-eslint';
import svelteConfig from './svelte.config.js';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...eslintPluginSvelte.configs['flat/recommended'],
eslintPluginPromise.configs['flat/recommended'],
// @ts-expect-error Not sure why it throws TS errors, but the config itself does work as expected
eslintPluginUnicorn.configs['flat/recommended'],
prettier,
...eslintPluginSvelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
SpotifyApi: 'readonly',
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
extraFileExtensions: ['.svelte'],
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
svelteConfig,
},
},
},
{
rules: {
//
// eslint
//
eqeqeq: 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'no-undef': 'off',
//
// @typescript-eslint
//
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
//
// eslint-plugin-unicorn
//
'unicorn/filename-case': 'off',
'unicorn/no-null': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-array-reduce': 'off',
//
// eslint-plugin-promise
//
'promise/always-return': 'off',
'promise/catch-or-return': ['error', { allowFinally: true }],
},
},
{
ignores: [],
},
);