-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
112 lines (103 loc) · 2.98 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
import globals from "globals";
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier";
import eslintConfigPrettier from "eslint-config-prettier";
/** @type {import('eslint').Linter.Config[]} */
export default [
// TypeScript files configuration
{
files: ["**/*.ts"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
...globals.browser
},
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
sourceType: "module"
}
},
plugins: {
"@typescript-eslint": tseslint.plugin,
prettier: prettier
},
rules: {
// TypeScript specific rules
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}],
"@typescript-eslint/no-non-null-assertion": "warn",
// General rules
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
"prettier/prettier": "error",
// Character file specific rules
"no-template-curly-in-string": "error",
"no-multi-str": "error",
"prefer-template": "error",
"quotes": ["error", "single", { "avoidEscape": true }],
// Import rules
"sort-imports": ["error", {
"ignoreCase": true,
"ignoreDeclarationSort": true
}]
}
},
// JavaScript files configuration
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
...globals.browser
}
},
plugins: {
prettier: prettier
},
rules: {
// General rules
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
"prettier/prettier": "error",
// Character file specific rules
"no-template-curly-in-string": "error",
"no-multi-str": "error",
"prefer-template": "error",
"quotes": ["error", "single", { "avoidEscape": true }],
// Import rules
"sort-imports": ["error", {
"ignoreCase": true,
"ignoreDeclarationSort": true
}]
}
},
// Prettier configuration
eslintConfigPrettier,
// Additional configurations for specific file patterns
{
files: ["src/agents/workflows/kol/characters/*.ts"],
rules: {
// Character file specific validations
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase"],
"filter": {
"regex": "^(name|username|description|personality|expertise|rules|trendFocus|contentFocus|replyStyle|wordsToAvoid|engagementCriteria|walletAddress)$",
"match": true
}
}
],
"no-multi-str": "error",
"no-template-curly-in-string": "error"
}
}
];