-
Notifications
You must be signed in to change notification settings - Fork 139
/
eslint.config.js
139 lines (137 loc) · 3.66 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";
import unusedImports from "eslint-plugin-unused-imports";
import markdown from "@eslint/markdown";
import stylisticJs from "@stylistic/eslint-plugin-js";
export default tseslint.config(
{
ignores: ["node_modules/**", "dist/**", "scripts/ibm_vllm_generate_protos/**"],
},
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
{
files: ["src/adapters/ibm-vllm/types.ts"],
rules: { "@typescript-eslint/unified-signatures": "off" },
},
{
files: ["**/*.md/**"],
languageOptions: {
parserOptions: {
project: null,
},
},
rules: {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
},
},
{
ignores: ["**/*.md/**"],
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
},
},
plugins: {
"unused-imports": unusedImports,
// @ts-expect-error wrong types
"@stylistic/js": stylisticJs,
},
rules: {
"no-console": ["error"],
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["../", "src/"],
message: "Relative imports are not allowed.",
},
],
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-floating-promises": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-object-type": "off",
"quote-props": ["error", "consistent"],
// Force a new line after the copyright header; otherwise, nwa reports them as incorrectly formatted
"@stylistic/js/lines-around-comment": [
"error",
{
applyDefaultIgnorePatterns: false,
afterBlockComment: true,
beforeBlockComment: false,
ignorePattern: /^(?![\s\S]*Copyright \d+ IBM Corp.)[\s\S]+$/u.source,
},
],
},
},
{
files: ["examples/**/*.{ts,js}"],
languageOptions: {
parserOptions: {
project: "./tsconfig.examples.json",
},
globals: {
setTimeout: "readonly",
},
},
rules: {
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-vars": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["@/"],
message: "Use 'bee-agent-framework' instead.",
},
],
},
],
},
},
{
files: ["examples/playground/**/*.ts"],
languageOptions: {
parserOptions: {
project: "./tsconfig.examples.json",
},
},
rules: {
"no-restricted-imports": "off",
},
},
// @ts-expect-error wrong types
...markdown.configs.processor,
prettierConfig,
{
rules: {
curly: ["error", "all"],
},
},
);