-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.mjs
68 lines (66 loc) · 1.85 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
import love from 'eslint-config-love'
import tseslint from 'typescript-eslint'
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
import jest from 'eslint-plugin-jest'
export default tseslint.config(
love,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
name: 'base',
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
}
},
linterOptions: {
reportUnusedDisableDirectives: 'error'
}
},
{
plugins: {
jest,
'simple-import-sort': simpleImportSortPlugin,
tseslint
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/init-declarations': 'off',
'eslint-comments/require-description': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error'
}
},
{
ignores: ['dist/**/*.*', '**/*.js', '**/*.mjs']
},
{
name: 'src',
files: ['src/**/*.ts'],
ignores: ['test/**/*.ts']
},
{
name: 'test',
files: ['test/**/*.ts'],
...jest.configs['flat/recommended'],
...jest.configs['flat/style'],
rules: {
// you should turn the original rule off *only* for test files
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/unbound-method': 'off',
'eslint-comments/require-description': 'off',
'jest/expect-expect': 'error',
'jest/prefer-comparison-matcher': 'error',
'jest/prefer-called-with': 'error',
'jest/prefer-equality-matcher': 'error',
'jest/prefer-lowercase-title': 'error',
'jest/require-top-level-describe': 'error',
'jest/unbound-method': 'error'
}
}
)