-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
82 lines (75 loc) · 1.69 KB
/
eslint.config.js
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
/**
* @file The eslint config.
*/
// Espree is yet to support import-attributes
// eslint-disable-next-line import/namespace, import/no-deprecated
import {ConfigGenerator} from "@logicer/eslint-plugin";
/**
* @type {import("@logicer/eslint-plugin").ConfigOptions}
*/
export const options = {
javascript: true,
jsdoc: true,
prettier: true,
typescript: true
};
const generator = new ConfigGenerator(options);
/**
* @type {import("eslint").Linter.FlatConfigFileSpec[]}
*/
const ignores = [
"node_modules/**/*",
".type-coverage/**/*",
"**/.eslint_report.json",
"**/.eslintcache"
];
/**
* @type {import("eslint").Linter.FlatConfig[]}
*/
const utilTypesConfigs = [
{
languageOptions: {
ecmaVersion: 2024,
parserOptions: {
ecmaVersion: 2024,
project: ["./tsconfig.json"],
sourceType: "module"
}
},
settings: {
"import/parsers": {
// Temporary until https://github.com/import-js/eslint-plugin-import/pull/2829
espree: [".js", ".jsx", ".cjs", ".mjs"]
},
"import/resolver": {
typescript: {
project: ["tsconfig.json"]
}
}
}
},
{
rules: {
"@typescript-eslint/naming-convention": "off"
}
},
{
files: ["tests/**/*"],
rules: {
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
];
/**
* @type {import("eslint").Linter.FlatConfig[]}
*/
const config = [
{ignores},
...(await generator.config),
...utilTypesConfigs,
...(await generator.endConfig)
];
export default config;