-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
98 lines (97 loc) · 2.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
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
import CodeX from 'eslint-config-codex';
import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint';
/**
* @todo connect architecture config
*/
export default [
...CodeX,
/**
* Override only for config files
*/
{
name: 'codex/codestyle/configs',
files: ['eslint.config.mjs', 'vitest.config.js'],
rules: {
'n/no-unpublished-import': ['off'],
'@typescript-eslint/naming-convention': ['off'],
},
},
/**
* Override for dev files that are not in source code (logically)
*/
{
name: 'codex/codestyle/dev-files',
files: ['src/tests/**/*', '**/*.test.ts'],
languageOptions: {
parser: TsParser,
parserOptions: {
project: 'tsconfig.test.json',
tsconfigRootDir: './',
sourceType: 'module',
},
},
rules: {
/**
* Current eslint version (9.2.0) has no alias resolver so this error is unfixable
*/
'n/no-missing-import': ['off'],
'n/no-unpublished-import': ['error', {
allowModules: ['vitest', 'postgres-migrations', '@testcontainers/localstack'],
ignoreTypeImport: true,
}],
/**
* @todo get rid of this rule ignores and solve all eslint errors occured
*/
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-magic-numbers': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/restrict-template-expressions': ['off'],
'jsdoc/require-jsdoc': ['off'],
},
},
/**
* Override for sourve code files
*/
{
name: 'notex.api',
ignores: ['vitest.config.js', 'eslint.config.mjs', 'src/tests/**/*', '**/*.test.ts'],
plugins: {
'@typescript-eslint': TsPlugin,
},
languageOptions: {
parser: TsParser,
parserOptions: {
project: 'tsconfig.eslint.json',
tsconfigRootDir: './',
sourceType: 'module',
},
},
rules: {
/**
* Current eslint version (9.2.0) has no alias resolver so this error is unfixable
*/
'n/no-missing-import': ['off'],
'n/no-unpublished-import': ['error'],
'n/no-unsupported-features/es-builtins': ['error', {
version: '>=22.1.0',
}],
'@typescript-eslint/naming-convention': ['error', {
selector: 'property',
format: ['camelCase', 'PascalCase'],
filter: {
regex: '^(?!(2xx|2[0-9][0-9]|application/json)$).*',
match: true,
},
}],
/**
* @todo get rid of this rule ignores and solve all eslint errors occured
*/
'@typescript-eslint/no-misused-promises': ['off'],
'jsdoc/require-jsdoc': ['off'],
'jsdoc/informative-docs': ['off'],
'jsdoc/require-returns-description': ['off'],
},
},
];