-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
105 lines (105 loc) · 3.38 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 2020,
project: ['./packages/*/tsconfig.json'],
sourceType: 'module',
// To enable all rules in svelte files:
extraFileExtensions: ['.svelte'],
},
env: { browser: true, es2017: true, node: true },
globals: {
$$Generic: 'readonly', // see https://github.com/sveltejs/svelte-eslint-parser/issues/306
App: 'readonly',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/strict',
'plugin:unicorn/recommended',
'plugin:svelte/recommended',
'prettier',
],
settings: { 'svelte/typescript': () => require('typescript') },
rules: {
'no-warning-comments': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-empty-object-type': [
'error',
{ allowInterfaces: 'with-single-extends' },
],
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
'capitalized-comments': 'off',
'curly': ['error', 'multi-or-nest', 'consistent'],
'new-cap': 'off',
'no-await-in-loop': 'off',
'no-empty-pattern': 'off',
'no-empty': 'warn',
'prefer-const': 'warn',
'unicorn/consistent-function-scoping': ['error', { checkArrowFunctions: false }],
'unicorn/expiring-todo-comments': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'unicorn/no-document-cookie': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-empty-file': 'off', // TODO reenable before merging to main
'unicorn/no-array-callback-reference': 'off',
'unicorn/prefer-spread': process.argv.includes('--fix') ? 'off' : 'warn',
'unicorn/prefer-ternary': process.argv.includes('--fix') ? 'off' : 'warn',
},
overrides: [
{
files: ['*.ts'],
excludedFiles: ['packages/api/scripts/*'],
rules: {
'no-console': [
'error',
{
allow: ['warn', 'error', 'info', 'group', 'groupEnd'],
},
],
'unicorn/no-null': 'off',
},
},
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'no-undef-init': 'off',
'unicorn/consistent-destructuring': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-null': 'off',
'no-console': [
'error',
{
allow: ['warn', 'error', 'info', 'group', 'groupEnd'],
},
],
},
},
],
};