-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
104 lines (103 loc) · 2.58 KB
/
Copy patheslint.config.ts
File metadata and controls
104 lines (103 loc) · 2.58 KB
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
import js from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
import importPlugin from "eslint-plugin-import-x";
import { defineConfig } from "eslint/config";
import globals from "globals";
import ts from "typescript-eslint";
export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: {
globals: globals.node
}
},
ts.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
prettierConfig,
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
ecmaVersion: "latest"
}
},
rules: {
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
"import-x/no-unresolved": "error",
"import-x/no-duplicates": "error",
"import-x/newline-after-import": ["error", { count: 1 }],
"import-x/order": [
"error",
{
groups: ["builtin", "external", "internal", ["parent", "sibling", "index"], "object", "type"],
pathGroups: [
{
pattern: "@/**",
group: "internal"
}
],
pathGroupsExcludedImportTypes: ["builtin"],
alphabetize: {
order: "asc",
caseInsensitive: true
}
}
],
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "inline-type-imports"
}
],
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true
}
],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
}
],
eqeqeq: ["error", "always"],
curly: ["error", "all"],
"no-useless-return": "error",
"no-throw-literal": "error",
"no-void": ["error", { allowAsStatement: true }],
"no-console": "off",
"no-var": "error",
"prefer-const": "error"
},
settings: {
"import-x/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json"
},
node: {
extensions: [".js", ".ts"]
}
}
}
}
]);