-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.cjs
112 lines (112 loc) · 3.59 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
106
107
108
109
110
111
112
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
project: './tsconfig.json',
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
plugins: ['simple-import-sort', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
],
rules: {
'no-unused-vars': 'off',
// Useful for triggering Svelte reactivity
'no-self-assign': 'off',
/* eslint-plugin-simple-import-sort */
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
/* @typescript-eslint/eslint-plugin */
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
'@typescript-eslint/unbound-method': 'off',
},
overrides: [
{
files: ['**/*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
extends: ['plugin:svelte/recommended', 'plugin:svelte/prettier'],
rules: {},
},
{
files: ['./scripts/testing/load/tests/**/*.js'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
{
files: ['**/*.cjs', '**/*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['src/**/*.{node-test,dom-test}.ts'],
rules: {
'@typescript-eslint/require-await': 'off',
},
},
{
files: ['src/**/*.node-test.{js,ts}'],
extends: ['plugin:jest-dom/recommended'],
rules: {
'jest-dom/prefer-in-document': 'off',
},
},
{
files: ['src/**/*.dom-test.{js,ts}'],
plugins: ['testing-library'],
extends: ['plugin:testing-library/dom', 'plugin:jest-dom/recommended'],
rules: {
'jest-dom/prefer-in-document': 'off',
'testing-library/prefer-presence-queries': 'off',
'testing-library/prefer-screen-queries': 'off',
},
},
{
files: ['tests/playwright/**/*.{api-test,e2e-test}.{js,ts}'],
extends: ['plugin:playwright/recommended'],
rules: {
'playwright/expect-expect': 'off',
},
},
],
};