/
.eslintrc.cjs
81 lines (81 loc) · 1.9 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:svelte/recommended',
'plugin:import/typescript',
'plugin:unicorn/recommended',
'plugin:promise/recommended',
'plugin:prettier/recommended',
],
plugins: [
'@typescript-eslint',
'simple-import-sort',
'import',
'unicorn',
'promise',
],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2024: true,
node: true,
},
globals: {
SpotifyApi: 'readonly',
},
reportUnusedDisableDirectives: true,
rules: {
//
// eslint
//
eqeqeq: 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
//
// @typescript-eslint
//
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
//
// eslint-plugin-import
//
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
//
// eslint-plugin-simple-import-sort
//
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
//
// 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 }],
},
};