@agilebot/eslint-config 0.3.12 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.3.12
2
+ * @license @agilebot/eslint-config v0.3.14
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
package/dist/index.d.ts CHANGED
@@ -73,6 +73,10 @@ interface FactoryOptions {
73
73
  * @default true
74
74
  */
75
75
  import?: boolean;
76
+ /**
77
+ * Flag indicating which import resolver to use
78
+ */
79
+ importResolver?: 'typescript' | 'oxc';
76
80
  }
77
81
 
78
82
  declare function factory(root: string, options?: FactoryOptions): Linter.BaseConfig;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.3.12
2
+ * @license @agilebot/eslint-config v0.3.14
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_yhzs7l56qchbrq23cntj5il5wu/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_yhzs7l56qchbrq23cntj5il5wu/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
- Object.entries(import_eslint_config_love.default.rules).forEach(([key, value]) => {
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-loss-of-precision":["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/ban-types":["error",{"extendDefaults":false,"types":{"String":{"message":"Use string instead","fixWith":"string"},"Boolean":{"message":"Use boolean instead","fixWith":"boolean"},"Number":{"message":"Use number instead","fixWith":"number"},"Symbol":{"message":"Use symbol instead","fixWith":"symbol"},"BigInt":{"message":"Use bigint instead","fixWith":"bigint"},"Function":{"message":"The `Function` type accepts any function-like value.\\nIt provides no type safety when calling the function, which can be a common source of bugs.\\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.\\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape."},"Object":{"message":"The `Object` type actually means \\"any non-nullish value\\", so it is marginally better than `unknown`.\\n- If you want a type meaning \\"any object\\", you probably want `Record<string, unknown>` instead.\\n- If you want a type meaning \\"any value\\", you probably want `unknown` instead."},"{}":{"message":"`{}` actually means \\"any non-nullish value\\".\\n- If you want a type meaning \\"any object\\", you probably want `Record<string, unknown>` instead.\\n- If you want a type meaning \\"any value\\", you probably want `unknown` instead."}}}],"@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-loss-of-precision":["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-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-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-var-requires":["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-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 {
@@ -546,7 +121,17 @@ function standard() {
546
121
  "promise/valid-params": "error",
547
122
  "promise/no-multiple-resolved": "error",
548
123
  "promise/no-return-in-finally": "error",
549
- "promise/prefer-await-to-then": "warn"
124
+ "promise/prefer-await-to-then": "warn",
125
+ // 自定义standard规则
126
+ "@typescript-eslint/max-params": ["error", { max: 5 }],
127
+ "@typescript-eslint/only-throw-error": [
128
+ "error",
129
+ {
130
+ allowThrowingAny: true,
131
+ allowThrowingUnknown: true
132
+ }
133
+ ],
134
+ "@typescript-eslint/no-loop-func": "warn"
550
135
  }), disabled.rules)
551
136
  };
552
137
  }
@@ -563,13 +148,18 @@ function standardDisabled() {
563
148
  "@typescript-eslint/strict-boolean-expressions": "off",
564
149
  "@typescript-eslint/explicit-function-return-type": "off",
565
150
  "@typescript-eslint/restrict-template-expressions": "off",
566
- "@typescript-eslint/no-unsafe-argument": "off"
151
+ "@typescript-eslint/no-unsafe-argument": "off",
152
+ "@typescript-eslint/class-methods-use-this": "off",
153
+ // v58.0.0
154
+ "@typescript-eslint/no-explicit-any": "off",
155
+ // v57.0.0
156
+ "@typescript-eslint/init-declarations": "off",
157
+ "@typescript-eslint/no-empty-function": "off"
567
158
  }
568
159
  };
569
160
  }
570
161
 
571
162
  // src/configs/ts.ts
572
- init_cjs_shims();
573
163
  var import_eslint_utils = require("@agilebot/eslint-utils");
574
164
  function ts() {
575
165
  return {
@@ -673,6 +263,7 @@ function ts() {
673
263
  function tsOnly() {
674
264
  return {
675
265
  rules: {
266
+ "prefer-object-has-own": "error",
676
267
  "@typescript-eslint/explicit-member-accessibility": "error"
677
268
  }
678
269
  };
@@ -698,7 +289,6 @@ function dts() {
698
289
  }
699
290
 
700
291
  // src/configs/imports.ts
701
- init_cjs_shims();
702
292
  var import_node_path = __toESM(require("path"));
703
293
  var import_node_fs = __toESM(require("fs"));
704
294
  var import_eslint_utils2 = require("@agilebot/eslint-utils");
@@ -728,7 +318,14 @@ function imports(opts) {
728
318
  plugins: ["import-x", "no-relative-import-paths"],
729
319
  extends: ["plugin:import-x/recommended", "plugin:import-x/typescript"],
730
320
  rules: {
731
- "import-x/no-unresolved": "error",
321
+ "import-x/no-unresolved": [
322
+ "error",
323
+ {
324
+ ignore: [
325
+ String.raw`\?(react|raw|url|inline|worker|worker&inline|worker&url|sharedworker|sharedworker&inline|sharedworker&url)$`
326
+ ]
327
+ }
328
+ ],
732
329
  "import-x/no-named-as-default-member": "off",
733
330
  "import-x/no-named-as-default": "off",
734
331
  "import-x/no-useless-path-segments": [
@@ -798,8 +395,12 @@ function imports(opts) {
798
395
  "import-x/parsers": {
799
396
  "@typescript-eslint/parser": [".ts", ".tsx"]
800
397
  },
801
- "import-x/resolver": {
398
+ "import-x/resolver": opts.resolver === "oxc" ? {
802
399
  oxc: true
400
+ } : {
401
+ typescript: {
402
+ alwaysTryTypes: true
403
+ }
803
404
  },
804
405
  "import-x/internal-regex": opts.monorepoScope ? `^${opts.monorepoScope.replace(/\//g, "")}/` : void 0,
805
406
  "import-x/core-modules": (_b = opts.coreModules) != null ? _b : void 0
@@ -808,7 +409,6 @@ function imports(opts) {
808
409
  }
809
410
 
810
411
  // src/configs/unicorn.ts
811
- init_cjs_shims();
812
412
  function unicorn(opts) {
813
413
  return {
814
414
  plugins: ["unicorn"],
@@ -847,7 +447,6 @@ function unicorn(opts) {
847
447
  }
848
448
 
849
449
  // src/configs/react.ts
850
- init_cjs_shims();
851
450
  function react(opts) {
852
451
  return {
853
452
  plugins: [
@@ -955,7 +554,6 @@ function react(opts) {
955
554
  }
956
555
 
957
556
  // src/configs/vue.ts
958
- init_cjs_shims();
959
557
  function vue(opts) {
960
558
  return {
961
559
  extends: [
@@ -965,7 +563,6 @@ function vue(opts) {
965
563
  }
966
564
 
967
565
  // src/configs/jsdoc.ts
968
- init_cjs_shims();
969
566
  function jsdoc(opt) {
970
567
  return {
971
568
  plugins: ["jsdoc"],
@@ -992,7 +589,6 @@ function jsdoc(opt) {
992
589
  }
993
590
 
994
591
  // src/configs/lodash.ts
995
- init_cjs_shims();
996
592
  function lodash() {
997
593
  return {
998
594
  // lodash一些方法可能影响性能,如forEach等,优先使用js的原生方法
@@ -1001,7 +597,6 @@ function lodash() {
1001
597
  }
1002
598
 
1003
599
  // src/configs/comments.ts
1004
- init_cjs_shims();
1005
600
  function comments() {
1006
601
  return {
1007
602
  plugins: ["eslint-comments"],
@@ -1026,7 +621,6 @@ function comments() {
1026
621
  }
1027
622
 
1028
623
  // src/configs/deprecation.ts
1029
- init_cjs_shims();
1030
624
  function deprecation() {
1031
625
  return {
1032
626
  plugins: ["deprecation"],
@@ -1038,7 +632,6 @@ function deprecation() {
1038
632
  }
1039
633
 
1040
634
  // src/configs/cspell.ts
1041
- init_cjs_shims();
1042
635
  function cspell(opts) {
1043
636
  return {
1044
637
  plugins: ["@cspell"],
@@ -1058,7 +651,6 @@ function cspell(opts) {
1058
651
  }
1059
652
 
1060
653
  // src/configs/agilebot.ts
1061
- init_cjs_shims();
1062
654
  function agilebot(opts) {
1063
655
  return {
1064
656
  extends: ["plugin:@agilebot/recommended"],
@@ -1093,7 +685,6 @@ function agilebot(opts) {
1093
685
  }
1094
686
 
1095
687
  // src/configs/prettier.ts
1096
- init_cjs_shims();
1097
688
  var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"));
1098
689
  function prettier() {
1099
690
  return {
@@ -1114,7 +705,6 @@ function prettier() {
1114
705
  }
1115
706
 
1116
707
  // src/configs/godaddy.ts
1117
- init_cjs_shims();
1118
708
  function godaddy() {
1119
709
  return {
1120
710
  parserOptions: {
@@ -1146,7 +736,6 @@ function godaddy() {
1146
736
  }
1147
737
 
1148
738
  // src/constants.ts
1149
- init_cjs_shims();
1150
739
  var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
1151
740
  var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
1152
741
  var DTS_EXTS = [".d.ts", ".d.cts", ".d.mts"];
@@ -1165,7 +754,8 @@ function factory(root, options) {
1165
754
  prettier: true,
1166
755
  lodash: true,
1167
756
  cspell: true,
1168
- import: true
757
+ import: true,
758
+ importResolver: "typescript"
1169
759
  };
1170
760
  options = __spreadValues(__spreadValues({}, defaultOptions), options);
1171
761
  if (options == null ? void 0 : options.config) {
@@ -1185,7 +775,8 @@ function factory(root, options) {
1185
775
  packageDir: root,
1186
776
  devDependencies: options == null ? void 0 : options.devDependencies,
1187
777
  monorepoScope: options == null ? void 0 : options.monorepoScope,
1188
- coreModules: options == null ? void 0 : options.coreModules
778
+ coreModules: options == null ? void 0 : options.coreModules,
779
+ resolver: options == null ? void 0 : options.importResolver
1189
780
  }) : {},
1190
781
  options.prettier ? prettier() : {}
1191
782
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "bin": {
6
6
  "eslint-agilebot": "bin/eslint-agilebot"
@@ -26,6 +26,7 @@
26
26
  "eslint-config-godaddy": "^6.0.0",
27
27
  "eslint-config-prettier": "^9.1.0",
28
28
  "eslint-import-resolver-oxc": "^0.2.0",
29
+ "eslint-import-resolver-typescript": "^3.6.1",
29
30
  "eslint-plugin-deprecation": "^3.0.0",
30
31
  "eslint-plugin-eslint-comments": "^3.2.0",
31
32
  "eslint-plugin-file-progress": "^1.4.0",
@@ -44,14 +45,14 @@
44
45
  "eslint-plugin-vue": "^9.26.0",
45
46
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
46
47
  "vue-eslint-parser": "^9.4.2",
47
- "@agilebot/eslint-utils": "0.3.12"
48
+ "@agilebot/eslint-utils": "0.3.14"
48
49
  },
49
50
  "devDependencies": {
50
- "eslint-config-love": "^47.0.0"
51
+ "eslint-config-love": "^62.0.0"
51
52
  },
52
53
  "peerDependencies": {
53
54
  "eslint": "^7.0.0 || ^8.0.0",
54
- "@agilebot/eslint-plugin": "0.3.12"
55
+ "@agilebot/eslint-plugin": "0.3.14"
55
56
  },
56
57
  "files": [
57
58
  "bin",