-
Notifications
You must be signed in to change notification settings - Fork 252
/
Copy patheslint.config.mjs
90 lines (89 loc) · 2.58 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import baseConfig from '@ph.fritsche/eslint-config'
import localRules from 'eslint-plugin-local-rules'
import globals from 'globals'
import {fixupPluginRules} from '@eslint/compat'
export default [
...baseConfig,
{
ignores: [
'testenv/',
],
},
{
files: [
'eslint-local-rules/*.js',
'scripts/*.js',
'*rc.js',
'*.config.js',
],
languageOptions: {
globals: globals.node,
},
},
{
files: ['src/**'],
plugins: {
'local-rules': fixupPluginRules(localRules),
},
rules: {
'local-rules/explicit-globals': 'error',
},
},
{
rules: {
'@stylistic/block-spacing': 'off',
'@stylistic/brace-style': 'warn',
'@stylistic/indent': ['warn', 2, {
offsetTernaryExpressions: true,
}],
'@stylistic/indent-binary-ops': 'warn',
'@stylistic/keyword-spacing': 'warn',
'@stylistic/lines-between-class-members': 'off',
'@stylistic/member-delimiter-style': 'warn',
'@stylistic/no-trailing-spaces': 'warn',
'@stylistic/operator-linebreak': ['warn', 'after', {
overrides: {
'?': 'before',
':': 'before',
},
}],
'@stylistic/quote-props': 'warn',
'@stylistic/space-in-parens': 'warn',
'@stylistic/spaced-comment': 'warn',
'no-await-in-loop': 'off',
'testing-library/no-dom-import': 'off',
'testing-library/no-node-access': 'off',
},
},
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-wrapper-object-types': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
},
},
{
files: [['tests/**', '**/*.{ts,tsx}']],
rules: {
'jest/expect-expect': 'off',
'jest/no-alias-methods': 'off',
'jest/no-conditional-expect': 'off',
'jest/no-export': 'off',
'jest/no-identical-title': 'warn',
'jest/no-standalone-expect': 'off',
'jest/valid-title': 'off',
'testing-library/no-container': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
},
},
]