-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
116 lines (108 loc) · 2.73 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import js from "@eslint/js";
import filenames from "@kavsingh/eslint-plugin-filenames";
import importX from "eslint-plugin-import-x";
import prettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";
import * as tsEslint from "typescript-eslint";
export default tsEslint.config(
{
ignores: [".vscode/*", ".turbo/*", ".temp/*", "apps/*", "packages/*"],
},
{
linterOptions: { reportUnusedDisableDirectives: true },
languageOptions: {
globals: { ...globals.node },
parserOptions: { projectService: true },
},
},
js.configs.recommended,
...tsEslint.configs.strictTypeChecked,
...tsEslint.configs.stylisticTypeChecked,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
filenames.configs.kebab,
{
rules: {
"camelcase": "off",
"no-console": "off",
"no-restricted-syntax": [
"warn",
{ selector: "TSEnumDeclaration", message: "Avoid using enums" },
],
"no-unreachable": "error",
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/member-ordering": ["warn"],
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowNumber: true },
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error",
{
ignoreTypeValueShadow: false,
ignoreFunctionTypeParameterNameValueShadow: true,
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import-x/no-cycle": "error",
"import-x/no-self-import": "error",
"import-x/no-unused-modules": "error",
"import-x/no-useless-path-segments": "error",
"import-x/order": [
"warn",
{
"alphabetize": { order: "asc" },
"groups": [
"builtin",
"external",
"internal",
"parent",
["sibling", "index"],
"type",
],
"pathGroupsExcludedImportTypes": ["type"],
"newlines-between": "always",
},
],
},
},
{
files: ["**/*.c[tj]s?(x)"],
languageOptions: {
sourceType: "commonjs",
parserOptions: { sourceType: "commonjs" },
},
rules: {
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["*.?(m|c)[tj]s?(x)"],
rules: {
"filenames/match-exported": "off",
},
},
prettierRecommended,
{
rules: {
"curly": ["warn", "multi-line", "consistent"],
"prettier/prettier": "warn",
},
},
);