@agilebot/eslint-config 0.3.13 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.js +15 -2
- package/dist/index.js +42 -461
- package/package.json +21 -22
package/dist/cli.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.
|
2
|
+
* @license @agilebot/eslint-config v0.4.0
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -56,12 +56,24 @@ var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
|
|
56
56
|
var IS_ESLINT = /^\.eslint.*/;
|
57
57
|
|
58
58
|
// src/cli/index.ts
|
59
|
+
function patch() {
|
60
|
+
process.env.ESLINT_USE_FLAT_CONFIG = "false";
|
61
|
+
const oldEmitWarning = process.emitWarning;
|
62
|
+
process.emitWarning = (warning, ...args) => {
|
63
|
+
if (args[0] === "ESLintRCWarning") {
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
oldEmitWarning(warning, ...args);
|
67
|
+
};
|
68
|
+
}
|
59
69
|
function cli() {
|
70
|
+
patch();
|
60
71
|
const cwd = process.cwd();
|
61
72
|
const has = {
|
62
73
|
ext: false,
|
63
74
|
fix: false,
|
64
75
|
config: false,
|
76
|
+
strict: false,
|
65
77
|
checkIntl: false,
|
66
78
|
progress: false
|
67
79
|
};
|
@@ -71,6 +83,7 @@ function cli() {
|
|
71
83
|
has.ext = has.ext || arg === "--ext";
|
72
84
|
has.fix = has.fix || arg === "--fix";
|
73
85
|
has.config = has.config || arg === "-c" || arg === "--config";
|
86
|
+
has.strict = has.strict || arg === "--strict";
|
74
87
|
has.checkIntl = has.checkIntl || arg === "--check-intl";
|
75
88
|
has.progress = has.progress || arg === "--progress";
|
76
89
|
});
|
@@ -101,7 +114,7 @@ function cli() {
|
|
101
114
|
has.config = has.config || files.some((file) => {
|
102
115
|
return IS_ESLINT.test(file);
|
103
116
|
});
|
104
|
-
if (!has.config) {
|
117
|
+
if (has.strict && !has.config) {
|
105
118
|
throw new Error("No ESLint configuration file found");
|
106
119
|
}
|
107
120
|
require(bin);
|
package/dist/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.
|
2
|
+
* @license @agilebot/eslint-config v0.4.0
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -31,12 +31,6 @@ var __spreadValues = (a, b) => {
|
|
31
31
|
return a;
|
32
32
|
};
|
33
33
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
34
|
-
var __esm = (fn, res) => function __init() {
|
35
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
36
|
-
};
|
37
|
-
var __commonJS = (cb, mod) => function __require() {
|
38
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
39
|
-
};
|
40
34
|
var __export = (target, all) => {
|
41
35
|
for (var name in all)
|
42
36
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -59,442 +53,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
59
53
|
));
|
60
54
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
61
55
|
|
62
|
-
// ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
|
63
|
-
var init_cjs_shims = __esm({
|
64
|
-
"../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
|
65
|
-
"use strict";
|
66
|
-
}
|
67
|
-
});
|
68
|
-
|
69
|
-
// ../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.16.0_@typescript-eslint+parser@7_dbttxvpwn6s6gyqfajsab2uz5m/node_modules/eslint-config-love/lib/index.js
|
70
|
-
var require_lib = __commonJS({
|
71
|
-
"../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.16.0_@typescript-eslint+parser@7_dbttxvpwn6s6gyqfajsab2uz5m/node_modules/eslint-config-love/lib/index.js"(exports2, module2) {
|
72
|
-
"use strict";
|
73
|
-
init_cjs_shims();
|
74
|
-
var eslint_1 = require("eslint");
|
75
|
-
var rules = {
|
76
|
-
"@typescript-eslint/adjacent-overload-signatures": ["error"],
|
77
|
-
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
78
|
-
"@typescript-eslint/await-thenable": ["error"],
|
79
|
-
"@typescript-eslint/ban-ts-comment": ["error", {
|
80
|
-
"ts-expect-error": "allow-with-description",
|
81
|
-
"ts-ignore": true,
|
82
|
-
"ts-nocheck": true,
|
83
|
-
"ts-check": false,
|
84
|
-
minimumDescriptionLength: 3
|
85
|
-
}],
|
86
|
-
"@typescript-eslint/ban-tslint-comment": ["error"],
|
87
|
-
"@typescript-eslint/ban-types": ["error", {
|
88
|
-
extendDefaults: false,
|
89
|
-
types: {
|
90
|
-
String: {
|
91
|
-
message: "Use string instead",
|
92
|
-
fixWith: "string"
|
93
|
-
},
|
94
|
-
Boolean: {
|
95
|
-
message: "Use boolean instead",
|
96
|
-
fixWith: "boolean"
|
97
|
-
},
|
98
|
-
Number: {
|
99
|
-
message: "Use number instead",
|
100
|
-
fixWith: "number"
|
101
|
-
},
|
102
|
-
Symbol: {
|
103
|
-
message: "Use symbol instead",
|
104
|
-
fixWith: "symbol"
|
105
|
-
},
|
106
|
-
BigInt: {
|
107
|
-
message: "Use bigint instead",
|
108
|
-
fixWith: "bigint"
|
109
|
-
},
|
110
|
-
Function: {
|
111
|
-
message: [
|
112
|
-
"The `Function` type accepts any function-like value.",
|
113
|
-
"It provides no type safety when calling the function, which can be a common source of bugs.",
|
114
|
-
"It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.",
|
115
|
-
"If you are expecting the function to accept certain arguments, you should explicitly define the function shape."
|
116
|
-
].join("\n")
|
117
|
-
},
|
118
|
-
// object typing
|
119
|
-
Object: {
|
120
|
-
message: [
|
121
|
-
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
122
|
-
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
|
123
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.'
|
124
|
-
].join("\n")
|
125
|
-
},
|
126
|
-
"{}": {
|
127
|
-
message: [
|
128
|
-
'`{}` actually means "any non-nullish value".',
|
129
|
-
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
|
130
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.'
|
131
|
-
].join("\n")
|
132
|
-
}
|
133
|
-
}
|
134
|
-
}],
|
135
|
-
"@typescript-eslint/block-spacing": ["error", "always"],
|
136
|
-
"@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
137
|
-
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
138
|
-
"@typescript-eslint/comma-dangle": ["error", {
|
139
|
-
arrays: "never",
|
140
|
-
objects: "never",
|
141
|
-
imports: "never",
|
142
|
-
exports: "never",
|
143
|
-
functions: "never",
|
144
|
-
enums: "ignore",
|
145
|
-
generics: "ignore",
|
146
|
-
tuples: "ignore"
|
147
|
-
}],
|
148
|
-
"@typescript-eslint/comma-spacing": ["error", { before: false, after: true }],
|
149
|
-
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
150
|
-
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
151
|
-
"@typescript-eslint/consistent-type-assertions": [
|
152
|
-
"error",
|
153
|
-
{
|
154
|
-
assertionStyle: "as",
|
155
|
-
objectLiteralTypeAssertions: "never"
|
156
|
-
}
|
157
|
-
],
|
158
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
159
|
-
"@typescript-eslint/consistent-type-exports": ["error", {
|
160
|
-
fixMixedExportsWithInlineTypeSpecifier: true
|
161
|
-
}],
|
162
|
-
"@typescript-eslint/consistent-type-imports": ["error", {
|
163
|
-
prefer: "type-imports",
|
164
|
-
disallowTypeAnnotations: true,
|
165
|
-
fixStyle: "inline-type-imports"
|
166
|
-
}],
|
167
|
-
"@typescript-eslint/dot-notation": [
|
168
|
-
"error",
|
169
|
-
{
|
170
|
-
allowIndexSignaturePropertyAccess: false,
|
171
|
-
allowKeywords: true,
|
172
|
-
allowPattern: "",
|
173
|
-
allowPrivateClassPropertyAccess: false,
|
174
|
-
allowProtectedClassPropertyAccess: false
|
175
|
-
}
|
176
|
-
],
|
177
|
-
"@typescript-eslint/explicit-function-return-type": ["error", {
|
178
|
-
allowExpressions: true,
|
179
|
-
allowHigherOrderFunctions: true,
|
180
|
-
allowTypedFunctionExpressions: true,
|
181
|
-
allowDirectConstAssertionInArrowFunctions: true
|
182
|
-
}],
|
183
|
-
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
184
|
-
"@typescript-eslint/indent": ["error", 2, {
|
185
|
-
SwitchCase: 1,
|
186
|
-
VariableDeclarator: 1,
|
187
|
-
outerIIFEBody: 1,
|
188
|
-
MemberExpression: 1,
|
189
|
-
FunctionDeclaration: { parameters: 1, body: 1 },
|
190
|
-
FunctionExpression: { parameters: 1, body: 1 },
|
191
|
-
CallExpression: { arguments: 1 },
|
192
|
-
ArrayExpression: 1,
|
193
|
-
ObjectExpression: 1,
|
194
|
-
ImportDeclaration: 1,
|
195
|
-
flatTernaryExpressions: false,
|
196
|
-
ignoreComments: false,
|
197
|
-
ignoredNodes: [
|
198
|
-
"TemplateLiteral *",
|
199
|
-
"JSXElement",
|
200
|
-
"JSXElement > *",
|
201
|
-
"JSXAttribute",
|
202
|
-
"JSXIdentifier",
|
203
|
-
"JSXNamespacedName",
|
204
|
-
"JSXMemberExpression",
|
205
|
-
"JSXSpreadAttribute",
|
206
|
-
"JSXExpressionContainer",
|
207
|
-
"JSXOpeningElement",
|
208
|
-
"JSXClosingElement",
|
209
|
-
"JSXFragment",
|
210
|
-
"JSXOpeningFragment",
|
211
|
-
"JSXClosingFragment",
|
212
|
-
"JSXText",
|
213
|
-
"JSXEmptyExpression",
|
214
|
-
"JSXSpreadChild"
|
215
|
-
],
|
216
|
-
offsetTernaryExpressions: true
|
217
|
-
}],
|
218
|
-
"@typescript-eslint/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
219
|
-
"@typescript-eslint/keyword-spacing": ["error", { before: true, after: true }],
|
220
|
-
"@typescript-eslint/lines-between-class-members": ["error", "always", { exceptAfterOverload: true, exceptAfterSingleLine: true }],
|
221
|
-
"@typescript-eslint/member-delimiter-style": [
|
222
|
-
"error",
|
223
|
-
{
|
224
|
-
multiline: { delimiter: "none" },
|
225
|
-
singleline: { delimiter: "comma", requireLast: false }
|
226
|
-
}
|
227
|
-
],
|
228
|
-
"@typescript-eslint/method-signature-style": ["error"],
|
229
|
-
"@typescript-eslint/naming-convention": ["error", {
|
230
|
-
selector: "variableLike",
|
231
|
-
leadingUnderscore: "allow",
|
232
|
-
trailingUnderscore: "allow",
|
233
|
-
format: ["camelCase", "PascalCase", "UPPER_CASE"]
|
234
|
-
}],
|
235
|
-
"@typescript-eslint/no-array-constructor": ["error"],
|
236
|
-
"@typescript-eslint/no-base-to-string": ["error"],
|
237
|
-
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: false, ignoreVoidOperator: false }],
|
238
|
-
"@typescript-eslint/no-dupe-class-members": ["error"],
|
239
|
-
"@typescript-eslint/no-dynamic-delete": ["error"],
|
240
|
-
"@typescript-eslint/no-empty-interface": ["error", { allowSingleExtends: true }],
|
241
|
-
"@typescript-eslint/no-extra-non-null-assertion": ["error"],
|
242
|
-
"@typescript-eslint/no-extra-parens": ["error", "functions"],
|
243
|
-
"@typescript-eslint/no-extraneous-class": ["error", { allowWithDecorator: true }],
|
244
|
-
"@typescript-eslint/no-floating-promises": ["error"],
|
245
|
-
"@typescript-eslint/no-for-in-array": ["error"],
|
246
|
-
"@typescript-eslint/no-implied-eval": ["error"],
|
247
|
-
"@typescript-eslint/no-invalid-void-type": ["error"],
|
248
|
-
"@typescript-eslint/no-loss-of-precision": ["error"],
|
249
|
-
"@typescript-eslint/no-misused-new": ["error"],
|
250
|
-
"@typescript-eslint/no-misused-promises": ["error"],
|
251
|
-
"@typescript-eslint/no-namespace": ["error"],
|
252
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain": ["error"],
|
253
|
-
"@typescript-eslint/no-non-null-assertion": ["error"],
|
254
|
-
"@typescript-eslint/no-redeclare": ["error", { builtinGlobals: false }],
|
255
|
-
"@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
|
256
|
-
"@typescript-eslint/no-throw-literal": ["error"],
|
257
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error"],
|
258
|
-
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
|
259
|
-
"@typescript-eslint/no-unnecessary-type-constraint": ["error"],
|
260
|
-
"@typescript-eslint/no-unsafe-argument": ["error"],
|
261
|
-
"@typescript-eslint/no-unused-expressions": ["error", {
|
262
|
-
allowShortCircuit: true,
|
263
|
-
allowTernary: true,
|
264
|
-
allowTaggedTemplates: true,
|
265
|
-
enforceForJSX: false
|
266
|
-
}],
|
267
|
-
"@typescript-eslint/no-unused-vars": ["error", {
|
268
|
-
args: "none",
|
269
|
-
caughtErrors: "none",
|
270
|
-
ignoreRestSiblings: true,
|
271
|
-
vars: "all"
|
272
|
-
}],
|
273
|
-
"@typescript-eslint/no-use-before-define": ["error", {
|
274
|
-
functions: false,
|
275
|
-
classes: false,
|
276
|
-
enums: false,
|
277
|
-
variables: false,
|
278
|
-
typedefs: false
|
279
|
-
}],
|
280
|
-
"@typescript-eslint/no-useless-constructor": ["error"],
|
281
|
-
"@typescript-eslint/no-var-requires": ["error"],
|
282
|
-
"@typescript-eslint/non-nullable-type-assertion-style": ["error"],
|
283
|
-
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
284
|
-
"@typescript-eslint/prefer-function-type": ["error"],
|
285
|
-
"@typescript-eslint/prefer-includes": ["error"],
|
286
|
-
"@typescript-eslint/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: false, ignoreMixedLogicalExpressions: false }],
|
287
|
-
"@typescript-eslint/prefer-optional-chain": ["error"],
|
288
|
-
"@typescript-eslint/prefer-promise-reject-errors": ["error"],
|
289
|
-
"@typescript-eslint/prefer-readonly": ["error"],
|
290
|
-
"@typescript-eslint/prefer-reduce-type-parameter": ["error"],
|
291
|
-
"@typescript-eslint/prefer-return-this-type": ["error"],
|
292
|
-
"@typescript-eslint/prefer-ts-expect-error": ["error"],
|
293
|
-
"@typescript-eslint/promise-function-async": ["error"],
|
294
|
-
"@typescript-eslint/quotes": ["error", "single", { avoidEscape: true, allowTemplateLiterals: false }],
|
295
|
-
"@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
|
296
|
-
"@typescript-eslint/restrict-plus-operands": ["error", { skipCompoundAssignments: false }],
|
297
|
-
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
|
298
|
-
"@typescript-eslint/return-await": ["error", "always"],
|
299
|
-
"@typescript-eslint/semi": ["error", "never"],
|
300
|
-
"@typescript-eslint/space-before-blocks": ["error", "always"],
|
301
|
-
"@typescript-eslint/space-before-function-paren": ["error", "always"],
|
302
|
-
"@typescript-eslint/space-infix-ops": ["error"],
|
303
|
-
"@typescript-eslint/strict-boolean-expressions": ["error", {
|
304
|
-
allowString: false,
|
305
|
-
allowNumber: false,
|
306
|
-
allowNullableObject: false,
|
307
|
-
allowNullableBoolean: false,
|
308
|
-
allowNullableString: false,
|
309
|
-
allowNullableNumber: false,
|
310
|
-
allowAny: false
|
311
|
-
}],
|
312
|
-
"@typescript-eslint/triple-slash-reference": ["error", { lib: "never", path: "never", types: "never" }],
|
313
|
-
"@typescript-eslint/type-annotation-spacing": ["error"],
|
314
|
-
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: false }],
|
315
|
-
"accessor-pairs": ["error", { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }],
|
316
|
-
"array-bracket-spacing": ["error", "never"],
|
317
|
-
"array-callback-return": ["error", {
|
318
|
-
allowImplicit: false,
|
319
|
-
allowVoid: false,
|
320
|
-
checkForEach: false
|
321
|
-
}],
|
322
|
-
"arrow-spacing": ["error", { before: true, after: true }],
|
323
|
-
"comma-style": ["error", "last"],
|
324
|
-
"computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
|
325
|
-
"constructor-super": ["error"],
|
326
|
-
curly: ["error", "multi-line"],
|
327
|
-
"default-case-last": ["error"],
|
328
|
-
"dot-location": ["error", "property"],
|
329
|
-
"eol-last": ["error"],
|
330
|
-
eqeqeq: ["error", "always", { null: "ignore" }],
|
331
|
-
"generator-star-spacing": ["error", { before: true, after: true }],
|
332
|
-
"multiline-ternary": ["error", "always-multiline"],
|
333
|
-
"new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
|
334
|
-
"new-parens": ["error"],
|
335
|
-
"no-async-promise-executor": ["error"],
|
336
|
-
"no-caller": ["error"],
|
337
|
-
"no-case-declarations": ["error"],
|
338
|
-
"no-class-assign": ["error"],
|
339
|
-
"no-compare-neg-zero": ["error"],
|
340
|
-
"no-cond-assign": ["error"],
|
341
|
-
"no-const-assign": ["error"],
|
342
|
-
"no-constant-condition": ["error", { checkLoops: false }],
|
343
|
-
"no-control-regex": ["error"],
|
344
|
-
"no-debugger": ["error"],
|
345
|
-
"no-delete-var": ["error"],
|
346
|
-
"no-dupe-args": ["error"],
|
347
|
-
"no-dupe-keys": ["error"],
|
348
|
-
"no-duplicate-case": ["error"],
|
349
|
-
"no-useless-backreference": ["error"],
|
350
|
-
"no-empty": ["error", { allowEmptyCatch: true }],
|
351
|
-
"no-empty-character-class": ["error"],
|
352
|
-
"no-empty-pattern": ["error"],
|
353
|
-
"no-eval": ["error"],
|
354
|
-
"no-ex-assign": ["error"],
|
355
|
-
"no-extend-native": ["error"],
|
356
|
-
"no-extra-bind": ["error"],
|
357
|
-
"no-extra-boolean-cast": ["error"],
|
358
|
-
"no-fallthrough": ["error"],
|
359
|
-
"no-floating-decimal": ["error"],
|
360
|
-
"no-func-assign": ["error"],
|
361
|
-
"no-global-assign": ["error"],
|
362
|
-
"no-import-assign": ["error"],
|
363
|
-
"no-invalid-regexp": ["error"],
|
364
|
-
"no-irregular-whitespace": ["error"],
|
365
|
-
"no-iterator": ["error"],
|
366
|
-
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
367
|
-
"no-lone-blocks": ["error"],
|
368
|
-
"no-misleading-character-class": ["error"],
|
369
|
-
"no-prototype-builtins": ["error"],
|
370
|
-
"no-useless-catch": ["error"],
|
371
|
-
"no-mixed-operators": ["error", {
|
372
|
-
groups: [
|
373
|
-
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
|
374
|
-
["&&", "||"],
|
375
|
-
["in", "instanceof"]
|
376
|
-
],
|
377
|
-
allowSamePrecedence: true
|
378
|
-
}],
|
379
|
-
"no-mixed-spaces-and-tabs": ["error"],
|
380
|
-
"no-multi-spaces": ["error"],
|
381
|
-
"no-multi-str": ["error"],
|
382
|
-
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
383
|
-
"no-new": ["error"],
|
384
|
-
"no-new-func": ["error"],
|
385
|
-
"no-new-object": ["error"],
|
386
|
-
"no-new-symbol": ["error"],
|
387
|
-
"no-new-wrappers": ["error"],
|
388
|
-
"no-obj-calls": ["error"],
|
389
|
-
"no-octal": ["error"],
|
390
|
-
"no-octal-escape": ["error"],
|
391
|
-
"no-proto": ["error"],
|
392
|
-
"no-regex-spaces": ["error"],
|
393
|
-
"no-return-assign": ["error", "except-parens"],
|
394
|
-
"no-self-assign": ["error", { props: true }],
|
395
|
-
"no-self-compare": ["error"],
|
396
|
-
"no-sequences": ["error"],
|
397
|
-
"no-shadow-restricted-names": ["error"],
|
398
|
-
"no-sparse-arrays": ["error"],
|
399
|
-
"no-tabs": ["error"],
|
400
|
-
"no-template-curly-in-string": ["error"],
|
401
|
-
"no-this-before-super": ["error"],
|
402
|
-
"no-trailing-spaces": ["error"],
|
403
|
-
"no-undef-init": ["error"],
|
404
|
-
"no-unexpected-multiline": ["error"],
|
405
|
-
"no-unmodified-loop-condition": ["error"],
|
406
|
-
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
407
|
-
"no-unreachable": ["error"],
|
408
|
-
"no-unreachable-loop": ["error"],
|
409
|
-
"no-unsafe-finally": ["error"],
|
410
|
-
"no-unsafe-negation": ["error"],
|
411
|
-
"no-useless-call": ["error"],
|
412
|
-
"no-useless-computed-key": ["error"],
|
413
|
-
"no-useless-escape": ["error"],
|
414
|
-
"no-useless-rename": ["error"],
|
415
|
-
"no-useless-return": ["error"],
|
416
|
-
"no-var": ["warn"],
|
417
|
-
"no-void": ["error", { allowAsStatement: true }],
|
418
|
-
"no-whitespace-before-property": ["error"],
|
419
|
-
"no-with": ["error"],
|
420
|
-
"object-curly-newline": ["error", { multiline: true, consistent: true }],
|
421
|
-
"object-property-newline": ["error", { allowMultiplePropertiesPerLine: true, allowAllPropertiesOnSameLine: false }],
|
422
|
-
"object-shorthand": ["warn", "properties"],
|
423
|
-
"one-var": ["error", { initialized: "never" }],
|
424
|
-
"operator-linebreak": ["error", "after", { overrides: { "?": "before", ":": "before", "|>": "before" } }],
|
425
|
-
"padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
|
426
|
-
"prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: false }],
|
427
|
-
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
428
|
-
"quote-props": ["error", "as-needed"],
|
429
|
-
"rest-spread-spacing": ["error", "never"],
|
430
|
-
"semi-spacing": ["error", { before: false, after: true }],
|
431
|
-
"space-in-parens": ["error", "never"],
|
432
|
-
"space-unary-ops": ["error", { words: true, nonwords: false }],
|
433
|
-
"spaced-comment": ["error", "always", {
|
434
|
-
line: { markers: ["*package", "!", "/", ",", "="] },
|
435
|
-
block: { balanced: true, markers: ["*package", "!", ",", ":", "::", "flow-include"], exceptions: ["*"] }
|
436
|
-
}],
|
437
|
-
"symbol-description": ["error"],
|
438
|
-
"template-curly-spacing": ["error", "never"],
|
439
|
-
"template-tag-spacing": ["error", "never"],
|
440
|
-
"unicode-bom": ["error", "never"],
|
441
|
-
"use-isnan": ["error", {
|
442
|
-
enforceForSwitchCase: true,
|
443
|
-
enforceForIndexOf: true
|
444
|
-
}],
|
445
|
-
"valid-typeof": ["error", { requireStringLiterals: true }],
|
446
|
-
"wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
|
447
|
-
"yield-star-spacing": ["error", "both"],
|
448
|
-
yoda: ["error", "never"],
|
449
|
-
"import/export": ["error"],
|
450
|
-
"import/first": ["error"],
|
451
|
-
"import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
|
452
|
-
"import/no-duplicates": ["error"],
|
453
|
-
"import/no-named-default": ["error"],
|
454
|
-
"import/no-webpack-loader-syntax": ["error"],
|
455
|
-
"n/handle-callback-err": ["error", "^(err|error)$"],
|
456
|
-
"n/no-callback-literal": ["error"],
|
457
|
-
"n/no-deprecated-api": ["error"],
|
458
|
-
"n/no-exports-assign": ["error"],
|
459
|
-
"n/no-new-require": ["error"],
|
460
|
-
"n/no-path-concat": ["error"],
|
461
|
-
"n/process-exit-as-throw": ["error"],
|
462
|
-
"promise/param-names": ["error"]
|
463
|
-
};
|
464
|
-
var eslintRuleNames = [...new eslint_1.Linter().getRules().keys()];
|
465
|
-
var namesOfEslintRulesForWhichWeAreUsingTsEquivalents = eslintRuleNames.filter((name) => Object.hasOwn(rules, `@typescript-eslint/${name}`));
|
466
|
-
var config = {
|
467
|
-
plugins: [
|
468
|
-
"@typescript-eslint",
|
469
|
-
"import",
|
470
|
-
"n",
|
471
|
-
"promise"
|
472
|
-
],
|
473
|
-
parser: "@typescript-eslint/parser",
|
474
|
-
parserOptions: {
|
475
|
-
project: true
|
476
|
-
},
|
477
|
-
rules: __spreadValues(__spreadValues({}, Object.fromEntries(namesOfEslintRulesForWhichWeAreUsingTsEquivalents.map((name) => [name, ["off"]]))), rules)
|
478
|
-
};
|
479
|
-
module2.exports = config;
|
480
|
-
}
|
481
|
-
});
|
482
|
-
|
483
56
|
// src/index.ts
|
484
57
|
var src_exports = {};
|
485
58
|
__export(src_exports, {
|
486
59
|
agilebot: () => factory
|
487
60
|
});
|
488
61
|
module.exports = __toCommonJS(src_exports);
|
489
|
-
init_cjs_shims();
|
490
62
|
|
491
63
|
// src/factory/index.ts
|
492
|
-
init_cjs_shims();
|
493
64
|
var import_node_assert = __toESM(require("assert"));
|
494
65
|
var import_eslint_utils3 = require("@agilebot/eslint-utils");
|
495
66
|
|
496
67
|
// src/configs/env.ts
|
497
|
-
init_cjs_shims();
|
498
68
|
function env() {
|
499
69
|
return {
|
500
70
|
env: {
|
@@ -509,11 +79,16 @@ function env() {
|
|
509
79
|
}
|
510
80
|
|
511
81
|
// src/configs/standard.ts
|
512
|
-
init_cjs_shims();
|
513
|
-
var import_eslint_config_love = __toESM(require_lib());
|
514
82
|
function standard() {
|
515
83
|
const standardRules = {};
|
516
|
-
|
84
|
+
const originalStdRules = (
|
85
|
+
// @ts-expect-error -- extracted rules from eslint-config-love
|
86
|
+
false ? {} : (
|
87
|
+
// @ts-expect-error -- extracted rules from eslint-config-love
|
88
|
+
JSON.parse('{"class-methods-use-this":["off"],"dot-notation":["off"],"init-declarations":["off"],"max-params":["off"],"no-array-constructor":["off"],"no-dupe-class-members":["off"],"no-empty-function":["off"],"no-implied-eval":["off"],"no-loop-func":["off"],"no-redeclare":["off"],"no-unused-expressions":["off"],"no-unused-vars":["off"],"no-use-before-define":["off"],"no-useless-constructor":["off"],"prefer-promise-reject-errors":["off"],"@typescript-eslint/adjacent-overload-signatures":["error"],"@typescript-eslint/array-type":["error",{"default":"array-simple"}],"@typescript-eslint/await-thenable":["error"],"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description","ts-ignore":true,"ts-nocheck":true,"ts-check":false,"minimumDescriptionLength":3}],"@typescript-eslint/ban-tslint-comment":["error"],"@typescript-eslint/class-methods-use-this":["error",{"exceptMethods":[],"enforceForClassFields":true,"ignoreOverrideMethods":false,"ignoreClassesThatImplementAnInterface":false}],"@typescript-eslint/class-literal-property-style":["error","fields"],"@typescript-eslint/consistent-generic-constructors":["error","constructor"],"@typescript-eslint/consistent-indexed-object-style":["error","record"],"@typescript-eslint/consistent-type-assertions":["error",{"assertionStyle":"as","objectLiteralTypeAssertions":"never"}],"@typescript-eslint/consistent-type-definitions":["error","interface"],"@typescript-eslint/consistent-type-exports":["error",{"fixMixedExportsWithInlineTypeSpecifier":true}],"@typescript-eslint/consistent-type-imports":["error",{"prefer":"type-imports","disallowTypeAnnotations":true,"fixStyle":"inline-type-imports"}],"@typescript-eslint/dot-notation":["error",{"allowIndexSignaturePropertyAccess":false,"allowKeywords":true,"allowPattern":"","allowPrivateClassPropertyAccess":false,"allowProtectedClassPropertyAccess":false}],"@typescript-eslint/explicit-function-return-type":["error",{"allowExpressions":true,"allowHigherOrderFunctions":true,"allowTypedFunctionExpressions":true,"allowDirectConstAssertionInArrowFunctions":true}],"@typescript-eslint/init-declarations":["error","always"],"@typescript-eslint/max-params":["error",{"max":4}],"@typescript-eslint/method-signature-style":["error"],"@typescript-eslint/naming-convention":["error",{"selector":"variableLike","leadingUnderscore":"allow","trailingUnderscore":"allow","format":["camelCase","PascalCase","UPPER_CASE"]}],"@typescript-eslint/no-array-constructor":["error"],"@typescript-eslint/no-array-delete":["error"],"@typescript-eslint/no-base-to-string":["error"],"@typescript-eslint/no-confusing-non-null-assertion":["error"],"@typescript-eslint/no-confusing-void-expression":["error",{"ignoreArrowShorthand":false,"ignoreVoidOperator":false}],"@typescript-eslint/no-dupe-class-members":["error"],"@typescript-eslint/no-duplicate-enum-values":["error"],"@typescript-eslint/no-duplicate-type-constituents":["error",{"ignoreIntersections":false,"ignoreUnions":false}],"@typescript-eslint/no-dynamic-delete":["error"],"@typescript-eslint/no-empty-function":["error",{"allow":[]}],"@typescript-eslint/no-explicit-any":["error",{"fixToUnknown":false,"ignoreRestArgs":false}],"@typescript-eslint/no-extra-non-null-assertion":["error"],"@typescript-eslint/no-extraneous-class":["error",{"allowWithDecorator":true}],"@typescript-eslint/no-empty-object-type":["error",{"allowInterfaces":"with-single-extends","allowObjectTypes":"never"}],"@typescript-eslint/no-floating-promises":["error"],"@typescript-eslint/no-for-in-array":["error"],"@typescript-eslint/no-implied-eval":["error"],"@typescript-eslint/no-import-type-side-effects":["error"],"@typescript-eslint/no-inferrable-types":["error",{"ignoreParameters":false,"ignoreProperties":false}],"@typescript-eslint/no-invalid-void-type":["error"],"@typescript-eslint/no-loop-func":["error"],"@typescript-eslint/no-misused-new":["error"],"@typescript-eslint/no-misused-promises":["error"],"@typescript-eslint/no-namespace":["error"],"@typescript-eslint/no-non-null-asserted-optional-chain":["error"],"@typescript-eslint/no-non-null-assertion":["error"],"@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@typescript-eslint/no-require-imports":["error",{"allow":[],"allowAsImport":false}],"@typescript-eslint/no-this-alias":["error",{"allowDestructuring":true}],"@typescript-eslint/no-unnecessary-boolean-literal-compare":["error"],"@typescript-eslint/no-unnecessary-type-assertion":["error"],"@typescript-eslint/no-unnecessary-type-constraint":["error"],"@typescript-eslint/no-unsafe-argument":["error"],"@typescript-eslint/no-unsafe-function-type":["error"],"@typescript-eslint/no-unused-expressions":["error",{"allowShortCircuit":true,"allowTernary":true,"allowTaggedTemplates":true,"enforceForJSX":false}],"@typescript-eslint/no-unused-vars":["error",{"args":"none","caughtErrors":"none","ignoreRestSiblings":true,"vars":"all"}],"@typescript-eslint/no-use-before-define":["error",{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"@typescript-eslint/no-useless-constructor":["error"],"@typescript-eslint/no-wrapper-object-types":["error"],"@typescript-eslint/non-nullable-type-assertion-style":["error"],"@typescript-eslint/only-throw-error":["error",{"allowThrowingAny":false,"allowThrowingUnknown":false}],"@typescript-eslint/prefer-function-type":["error"],"@typescript-eslint/prefer-includes":["error"],"@typescript-eslint/prefer-nullish-coalescing":["error",{"ignoreConditionalTests":false,"ignoreMixedLogicalExpressions":false}],"@typescript-eslint/prefer-optional-chain":["error"],"@typescript-eslint/prefer-promise-reject-errors":["error"],"@typescript-eslint/prefer-readonly":["error"],"@typescript-eslint/prefer-reduce-type-parameter":["error"],"@typescript-eslint/prefer-return-this-type":["error"],"@typescript-eslint/promise-function-async":["error"],"@typescript-eslint/require-array-sort-compare":["error",{"ignoreStringArrays":true}],"@typescript-eslint/restrict-plus-operands":["error",{"skipCompoundAssignments":false}],"@typescript-eslint/restrict-template-expressions":["error",{"allowNumber":true}],"@typescript-eslint/return-await":["error","always"],"@typescript-eslint/strict-boolean-expressions":["error",{"allowString":false,"allowNumber":false,"allowNullableObject":false,"allowNullableBoolean":false,"allowNullableString":false,"allowNullableNumber":false,"allowAny":false}],"@typescript-eslint/triple-slash-reference":["error",{"lib":"never","path":"never","types":"never"}],"@typescript-eslint/unbound-method":["error",{"ignoreStatic":false}],"accessor-pairs":["error",{"setWithoutGet":true,"getWithoutSet":false,"enforceForClassMembers":true}],"array-callback-return":["error",{"allowImplicit":false,"allowVoid":false,"checkForEach":false}],"constructor-super":["error"],"curly":["error","multi-line"],"default-case-last":["error"],"eqeqeq":["error","always",{"null":"ignore"}],"new-cap":["error",{"newIsCap":true,"capIsNew":false,"properties":true}],"no-async-promise-executor":["error"],"no-caller":["error"],"no-case-declarations":["error"],"no-class-assign":["error"],"no-compare-neg-zero":["error"],"no-cond-assign":["error"],"no-const-assign":["error"],"no-constant-condition":["error",{"checkLoops":false}],"no-control-regex":["error"],"no-debugger":["error"],"no-delete-var":["error"],"no-dupe-args":["error"],"no-dupe-keys":["error"],"no-duplicate-case":["error"],"no-useless-backreference":["error"],"no-empty":["error",{"allowEmptyCatch":true}],"no-empty-character-class":["error"],"no-empty-pattern":["error"],"no-eval":["error"],"no-ex-assign":["error"],"no-extend-native":["error"],"no-extra-bind":["error"],"no-extra-boolean-cast":["error"],"no-fallthrough":["error"],"no-func-assign":["error"],"no-global-assign":["error"],"no-import-assign":["error"],"no-invalid-regexp":["error"],"no-irregular-whitespace":["error"],"no-iterator":["error"],"no-labels":["error",{"allowLoop":false,"allowSwitch":false}],"no-lone-blocks":["error"],"no-loss-of-precision":["error"],"no-misleading-character-class":["error"],"no-prototype-builtins":["error"],"no-useless-catch":["error"],"no-multi-str":["error"],"no-new":["error"],"no-new-func":["error"],"no-new-symbol":["error"],"no-new-wrappers":["error"],"no-obj-calls":["error"],"no-object-constructor":["error"],"no-octal":["error"],"no-octal-escape":["error"],"no-proto":["error"],"no-regex-spaces":["error"],"no-return-assign":["error","except-parens"],"no-self-assign":["error",{"props":true}],"no-self-compare":["error"],"no-sequences":["error"],"no-shadow-restricted-names":["error"],"no-sparse-arrays":["error"],"no-template-curly-in-string":["error"],"no-this-before-super":["error"],"no-throw-literal":["off"],"no-undef-init":["error"],"no-unexpected-multiline":["error"],"no-unmodified-loop-condition":["error"],"no-unneeded-ternary":["error",{"defaultAssignment":false}],"no-unreachable":["error"],"no-unreachable-loop":["error"],"no-unsafe-finally":["error"],"no-unsafe-negation":["error"],"no-useless-call":["error"],"no-useless-computed-key":["error"],"no-useless-escape":["error"],"no-useless-rename":["error"],"no-useless-return":["error"],"no-var":["error"],"no-void":["error",{"allowAsStatement":true}],"no-with":["error"],"object-shorthand":["warn","properties"],"one-var":["error",{"initialized":"never"}],"prefer-const":["error",{"destructuring":"all","ignoreReadBeforeAssign":false}],"prefer-regex-literals":["error",{"disallowRedundantWrapping":true}],"symbol-description":["error"],"unicode-bom":["error","never"],"use-isnan":["error",{"enforceForSwitchCase":true,"enforceForIndexOf":true}],"valid-typeof":["error",{"requireStringLiterals":true}],"yoda":["error","never"],"import/export":["error"],"import/first":["error"],"import/no-absolute-path":["error",{"esmodule":true,"commonjs":true,"amd":false}],"import/no-duplicates":["error"],"import/no-named-default":["error"],"import/no-webpack-loader-syntax":["error"],"n/handle-callback-err":["error","^(err|error)$"],"n/no-callback-literal":["error"],"n/no-deprecated-api":["error"],"n/no-exports-assign":["error"],"n/no-new-require":["error"],"n/no-path-concat":["error"],"n/process-exit-as-throw":["error"],"promise/param-names":["error"]}')
|
89
|
+
)
|
90
|
+
);
|
91
|
+
Object.entries(originalStdRules).forEach(([key, value]) => {
|
517
92
|
if (key.startsWith("import/")) {
|
518
93
|
standardRules[`import-x/${key.slice(7)}`] = value;
|
519
94
|
} else {
|
@@ -536,6 +111,7 @@ function standard() {
|
|
536
111
|
"n/no-sync": "error",
|
537
112
|
// 尽量使用fs.promises而不是fs
|
538
113
|
"n/prefer-promises/fs": "error",
|
114
|
+
"n/prefer-promises/dns": "error",
|
539
115
|
// 路径拼接使用path.join,而不是直接使用加号
|
540
116
|
"n/no-path-concat": "error",
|
541
117
|
"promise/no-return-wrap": "error",
|
@@ -546,7 +122,17 @@ function standard() {
|
|
546
122
|
"promise/valid-params": "error",
|
547
123
|
"promise/no-multiple-resolved": "error",
|
548
124
|
"promise/no-return-in-finally": "error",
|
549
|
-
"promise/prefer-await-to-then": "warn"
|
125
|
+
"promise/prefer-await-to-then": "warn",
|
126
|
+
// 自定义standard规则
|
127
|
+
"@typescript-eslint/max-params": ["error", { max: 5 }],
|
128
|
+
"@typescript-eslint/only-throw-error": [
|
129
|
+
"error",
|
130
|
+
{
|
131
|
+
allowThrowingAny: true,
|
132
|
+
allowThrowingUnknown: true
|
133
|
+
}
|
134
|
+
],
|
135
|
+
"@typescript-eslint/no-loop-func": "warn"
|
550
136
|
}), disabled.rules)
|
551
137
|
};
|
552
138
|
}
|
@@ -563,13 +149,18 @@ function standardDisabled() {
|
|
563
149
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
564
150
|
"@typescript-eslint/explicit-function-return-type": "off",
|
565
151
|
"@typescript-eslint/restrict-template-expressions": "off",
|
566
|
-
"@typescript-eslint/no-unsafe-argument": "off"
|
152
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
153
|
+
"@typescript-eslint/class-methods-use-this": "off",
|
154
|
+
// v58.0.0
|
155
|
+
"@typescript-eslint/no-explicit-any": "off",
|
156
|
+
// v57.0.0
|
157
|
+
"@typescript-eslint/init-declarations": "off",
|
158
|
+
"@typescript-eslint/no-empty-function": "off"
|
567
159
|
}
|
568
160
|
};
|
569
161
|
}
|
570
162
|
|
571
163
|
// src/configs/ts.ts
|
572
|
-
init_cjs_shims();
|
573
164
|
var import_eslint_utils = require("@agilebot/eslint-utils");
|
574
165
|
function ts() {
|
575
166
|
return {
|
@@ -673,6 +264,7 @@ function ts() {
|
|
673
264
|
function tsOnly() {
|
674
265
|
return {
|
675
266
|
rules: {
|
267
|
+
"prefer-object-has-own": "error",
|
676
268
|
"@typescript-eslint/explicit-member-accessibility": "error"
|
677
269
|
}
|
678
270
|
};
|
@@ -680,7 +272,7 @@ function tsOnly() {
|
|
680
272
|
function jsOnly() {
|
681
273
|
return {
|
682
274
|
rules: {
|
683
|
-
"@typescript-eslint/no-
|
275
|
+
"@typescript-eslint/no-require-imports": "off"
|
684
276
|
}
|
685
277
|
};
|
686
278
|
}
|
@@ -698,7 +290,6 @@ function dts() {
|
|
698
290
|
}
|
699
291
|
|
700
292
|
// src/configs/imports.ts
|
701
|
-
init_cjs_shims();
|
702
293
|
var import_node_path = __toESM(require("path"));
|
703
294
|
var import_node_fs = __toESM(require("fs"));
|
704
295
|
var import_eslint_utils2 = require("@agilebot/eslint-utils");
|
@@ -819,7 +410,6 @@ function imports(opts) {
|
|
819
410
|
}
|
820
411
|
|
821
412
|
// src/configs/unicorn.ts
|
822
|
-
init_cjs_shims();
|
823
413
|
function unicorn(opts) {
|
824
414
|
return {
|
825
415
|
plugins: ["unicorn"],
|
@@ -858,7 +448,6 @@ function unicorn(opts) {
|
|
858
448
|
}
|
859
449
|
|
860
450
|
// src/configs/react.ts
|
861
|
-
init_cjs_shims();
|
862
451
|
function react(opts) {
|
863
452
|
return {
|
864
453
|
plugins: [
|
@@ -929,6 +518,10 @@ function react(opts) {
|
|
929
518
|
// recommended rules from @eslint-react/naming-convention
|
930
519
|
"@eslint-react/naming-convention/component-name": "error",
|
931
520
|
"@eslint-react/naming-convention/use-state": "error",
|
521
|
+
// recommended rules from @eslint-react/web-api
|
522
|
+
"@eslint-react/web-api/no-leaked-interval": "error",
|
523
|
+
"@eslint-react/web-api/no-leaked-timeout": "error",
|
524
|
+
"@eslint-react/web-api/no-leaked-event-listener": "error",
|
932
525
|
// 以下是自定义规则
|
933
526
|
"react/jsx-handler-names": [
|
934
527
|
"error",
|
@@ -938,8 +531,6 @@ function react(opts) {
|
|
938
531
|
checkLocalVariables: true
|
939
532
|
}
|
940
533
|
],
|
941
|
-
// 已经有ts校验,此规则没有必要,会与带静态属性的Functional Component冲突
|
942
|
-
"react/prop-types": "off",
|
943
534
|
// <App prop={'Hello'} />没必要,使用<App prop="Hello" />
|
944
535
|
"react/jsx-curly-brace-presence": [
|
945
536
|
"error",
|
@@ -966,7 +557,6 @@ function react(opts) {
|
|
966
557
|
}
|
967
558
|
|
968
559
|
// src/configs/vue.ts
|
969
|
-
init_cjs_shims();
|
970
560
|
function vue(opts) {
|
971
561
|
return {
|
972
562
|
extends: [
|
@@ -976,7 +566,6 @@ function vue(opts) {
|
|
976
566
|
}
|
977
567
|
|
978
568
|
// src/configs/jsdoc.ts
|
979
|
-
init_cjs_shims();
|
980
569
|
function jsdoc(opt) {
|
981
570
|
return {
|
982
571
|
plugins: ["jsdoc"],
|
@@ -1003,7 +592,6 @@ function jsdoc(opt) {
|
|
1003
592
|
}
|
1004
593
|
|
1005
594
|
// src/configs/lodash.ts
|
1006
|
-
init_cjs_shims();
|
1007
595
|
function lodash() {
|
1008
596
|
return {
|
1009
597
|
// lodash一些方法可能影响性能,如forEach等,优先使用js的原生方法
|
@@ -1012,21 +600,20 @@ function lodash() {
|
|
1012
600
|
}
|
1013
601
|
|
1014
602
|
// src/configs/comments.ts
|
1015
|
-
init_cjs_shims();
|
1016
603
|
function comments() {
|
1017
604
|
return {
|
1018
|
-
plugins: ["eslint-comments"],
|
605
|
+
plugins: ["@eslint-community/eslint-comments"],
|
1019
606
|
rules: {
|
1020
607
|
// 禁止未使用的eslint-disable注释
|
1021
|
-
"eslint-comments/no-unused-disable": "error",
|
608
|
+
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
1022
609
|
// 禁止无限制的eslint-disable注释
|
1023
|
-
"eslint-comments/no-unlimited-disable": "error",
|
610
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": "error",
|
1024
611
|
// 禁止重复的eslint-disable注释
|
1025
|
-
"eslint-comments/no-duplicate-disable": "error",
|
612
|
+
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
|
1026
613
|
// 禁止聚合的eslint-enable注释
|
1027
|
-
"eslint-comments/no-aggregating-enable": "error",
|
614
|
+
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
|
1028
615
|
// 须说明原因eslint-disable
|
1029
|
-
"eslint-comments/require-description": [
|
616
|
+
"@eslint-community/eslint-comments/require-description": [
|
1030
617
|
"error",
|
1031
618
|
{
|
1032
619
|
ignore: ["eslint-env", "exported", "global", "globals"]
|
@@ -1037,19 +624,17 @@ function comments() {
|
|
1037
624
|
}
|
1038
625
|
|
1039
626
|
// src/configs/deprecation.ts
|
1040
|
-
init_cjs_shims();
|
1041
627
|
function deprecation() {
|
1042
628
|
return {
|
1043
|
-
plugins: ["
|
629
|
+
plugins: ["@agilebot"],
|
1044
630
|
rules: {
|
1045
631
|
// 禁止使用带有deprecation标记的方法或属性
|
1046
|
-
"
|
632
|
+
"@agilebot/deprecation": "error"
|
1047
633
|
}
|
1048
634
|
};
|
1049
635
|
}
|
1050
636
|
|
1051
637
|
// src/configs/cspell.ts
|
1052
|
-
init_cjs_shims();
|
1053
638
|
function cspell(opts) {
|
1054
639
|
return {
|
1055
640
|
plugins: ["@cspell"],
|
@@ -1069,7 +654,6 @@ function cspell(opts) {
|
|
1069
654
|
}
|
1070
655
|
|
1071
656
|
// src/configs/agilebot.ts
|
1072
|
-
init_cjs_shims();
|
1073
657
|
function agilebot(opts) {
|
1074
658
|
return {
|
1075
659
|
extends: ["plugin:@agilebot/recommended"],
|
@@ -1104,7 +688,6 @@ function agilebot(opts) {
|
|
1104
688
|
}
|
1105
689
|
|
1106
690
|
// src/configs/prettier.ts
|
1107
|
-
init_cjs_shims();
|
1108
691
|
var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"));
|
1109
692
|
function prettier() {
|
1110
693
|
return {
|
@@ -1125,7 +708,6 @@ function prettier() {
|
|
1125
708
|
}
|
1126
709
|
|
1127
710
|
// src/configs/godaddy.ts
|
1128
|
-
init_cjs_shims();
|
1129
711
|
function godaddy() {
|
1130
712
|
return {
|
1131
713
|
parserOptions: {
|
@@ -1157,7 +739,6 @@ function godaddy() {
|
|
1157
739
|
}
|
1158
740
|
|
1159
741
|
// src/constants.ts
|
1160
|
-
init_cjs_shims();
|
1161
742
|
var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
|
1162
743
|
var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
|
1163
744
|
var DTS_EXTS = [".d.ts", ".d.cts", ".d.mts"];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.0",
|
4
4
|
"description": "Agilebot's ESLint config",
|
5
5
|
"bin": {
|
6
6
|
"eslint-agilebot": "bin/eslint-agilebot"
|
@@ -18,41 +18,40 @@
|
|
18
18
|
},
|
19
19
|
"homepage": "https://github.com/sh-agilebot/frontend-toolkit/tree/master/packages/eslint-config#readme",
|
20
20
|
"dependencies": {
|
21
|
-
"@cspell/eslint-plugin": "^8.
|
22
|
-
"@eslint-
|
23
|
-
"@
|
24
|
-
"@
|
25
|
-
"@typescript-eslint/
|
21
|
+
"@cspell/eslint-plugin": "^8.14.2",
|
22
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
23
|
+
"@eslint-react/eslint-plugin": "^1.12.1",
|
24
|
+
"@stylistic/eslint-plugin": "^2.6.4",
|
25
|
+
"@typescript-eslint/eslint-plugin": "~8.2.0",
|
26
|
+
"@typescript-eslint/parser": "~8.2.0",
|
26
27
|
"eslint-config-godaddy": "^6.0.0",
|
27
28
|
"eslint-config-prettier": "^9.1.0",
|
28
29
|
"eslint-import-resolver-oxc": "^0.2.0",
|
29
30
|
"eslint-import-resolver-typescript": "^3.6.1",
|
30
|
-
"eslint-plugin-
|
31
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
32
|
-
"eslint-plugin-file-progress": "^1.4.0",
|
31
|
+
"eslint-plugin-file-progress": "^1.5.0",
|
33
32
|
"eslint-plugin-import-x": "^3.1.0",
|
34
|
-
"eslint-plugin-jsdoc": "^
|
33
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
35
34
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
36
|
-
"eslint-plugin-n": "^17.10.
|
35
|
+
"eslint-plugin-n": "^17.10.2",
|
37
36
|
"eslint-plugin-no-relative-import-paths": "^1.5.5",
|
38
|
-
"eslint-plugin-prefer-arrow-functions": "^3.
|
37
|
+
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
|
39
38
|
"eslint-plugin-prettier": "^5.2.1",
|
40
|
-
"eslint-plugin-promise": "^7.
|
39
|
+
"eslint-plugin-promise": "^7.1.0",
|
41
40
|
"eslint-plugin-react": "^7.35.0",
|
42
41
|
"eslint-plugin-react-hooks": "^4.6.2",
|
43
|
-
"eslint-plugin-unicorn": "^
|
44
|
-
"eslint-plugin-unused-imports": "^
|
45
|
-
"eslint-plugin-vue": "^9.
|
42
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
43
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
44
|
+
"eslint-plugin-vue": "^9.27.0",
|
46
45
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
|
47
|
-
"vue-eslint-parser": "^9.4.
|
48
|
-
"@agilebot/eslint-utils": "0.
|
46
|
+
"vue-eslint-parser": "^9.4.3",
|
47
|
+
"@agilebot/eslint-utils": "0.4.0"
|
49
48
|
},
|
50
49
|
"devDependencies": {
|
51
|
-
"eslint-config-love": "^
|
50
|
+
"eslint-config-love": "^63.0.0"
|
52
51
|
},
|
53
52
|
"peerDependencies": {
|
54
|
-
"eslint": "^7.0.0 || ^8.0.0",
|
55
|
-
"@agilebot/eslint-plugin": "0.
|
53
|
+
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
54
|
+
"@agilebot/eslint-plugin": "0.4.0"
|
56
55
|
},
|
57
56
|
"files": [
|
58
57
|
"bin",
|
@@ -60,6 +59,6 @@
|
|
60
59
|
],
|
61
60
|
"scripts": {
|
62
61
|
"build": "tsup",
|
63
|
-
"lint": "eslint src
|
62
|
+
"lint": "eslint-agilebot src"
|
64
63
|
}
|
65
64
|
}
|