-
Notifications
You must be signed in to change notification settings - Fork 6
/
eslint.config.mjs
105 lines (98 loc) · 2.94 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
99
100
101
102
103
104
105
import CodeX from 'eslint-config-codex';
import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint';
import VueParser from 'vue-eslint-parser';
import { FlatCompat } from '@eslint/eslintrc';
import path from 'path';
import { fileURLToPath } from 'url';
// mimic CommonJS variables
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
/**
* @todo connect architecture config
*/
export default [
...CodeX,
...compat.extends('.architecture.eslintrc'),
{
name: 'ts-notex.web',
ignores: ['codex-ui/**/*', '*.pcss', '*.otf', 'eslint.config.mjs'],
plugins: {
'@typescript-eslint': TsPlugin,
},
/**
* This are the options for typescript files
*/
languageOptions: {
parser: TsParser,
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: './',
sourceType: 'module', // Allows for the use of imports
},
},
rules: {
'n/no-missing-import': ['off'],
'n/no-unpublished-import': ['error', {
allowModules: ['vitest', 'postgres-migrations', 'eslint-config-codex'],
ignoreTypeImport: true,
}],
'n/no-unsupported-features/node-builtins': ['error', {
version: '>=22.1.0',
}],
'n/no-extraneous-import': ['error', {
allowModules: ['@editorjs/editorjs'],
}],
'@typescript-eslint/naming-convention': ['error', {
selector: 'property',
format: ['camelCase'],
filter: {
regex: '^(?!(2xx|2[0-9][0-9]|application/json|VITE.*|HAWK.*)$).*',
match: true,
},
}],
/**
* @todo get rid of this rule ignores and solve all eslint errors occured
*/
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'jsdoc/require-param-type': ['off'],
'jsdoc/informative-docs': ['off'],
'jsdoc/require-jsdoc': ['off'],
},
},
/**
* This override of the options for vue files
*/
{
languageOptions: {
parser: VueParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.vue'],
parser: TsParser,
sourceType: 'module',
},
},
rules: {
'n/no-missing-import': ['off'],
'n/no-unpublished-import': ['error', {
allowModules: ['vitest', 'postgres-migrations', 'eslint-import-resolver-alias', 'eslint-config-codex'],
ignoreTypeImport: true,
}],
'n/no-unsupported-features/node-builtins': ['error', {
version: '>=22.1.0',
}],
'jsdoc/require-param-type': ['off'],
'jsdoc/informative-docs': ['off'],
'jsdoc/require-jsdoc': ['off'],
},
},
];