-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
73 lines (71 loc) · 1.89 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
// @ts-check
import eslint from "@eslint/js";
import typescriptEslint from "typescript-eslint";
import pluginSonarJs from "eslint-plugin-sonarjs";
import pluginUnicorn from "eslint-plugin-unicorn";
import pluginImportX from "eslint-plugin-import-x";
import configPrettier from "eslint-config-prettier";
export default typescriptEslint.config({
extends: [
eslint.configs.recommended,
typescriptEslint.configs.recommendedTypeChecked,
typescriptEslint.configs.stylisticTypeChecked,
pluginSonarJs.configs.recommended,
pluginUnicorn.configs["flat/recommended"],
pluginImportX.flatConfigs.recommended,
pluginImportX.flatConfigs.typescript,
configPrettier,
],
plugins: {
"@typescript-eslint": typescriptEslint.plugin,
pluginImportX,
},
languageOptions: {
parser: typescriptEslint.parser,
parserOptions: {
tsconfigRootDir: import.meta.dir,
project: "./**/tsconfig.json",
},
},
settings: {
"import-x/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./**/tsconfig.json",
},
},
},
rules: {
"unicorn/filename-case": [
"error",
{
cases: {
camelCase: true,
pascalCase: true,
kebabCase: false,
snakeCase: false,
},
},
],
"sonarjs/todo-tag": "warn",
"import-x/no-deprecated": "error",
"import-x/no-empty-named-blocks": "error",
"import-x/no-mutable-exports": "error",
"import-x/no-absolute-path": "error",
"import-x/no-cycle": "error",
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["../../*"],
message: "Usage of relative parent imports is not allowed.",
},
],
},
],
"import-x/no-useless-path-segments": "error",
"import-x/first": "error",
},
ignores: ["node_modules/**", "**/eslint.config.js"],
});