@agilebot/eslint-config 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Agilebot, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Agilebot, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- require('../dist/cli');
1
+ #!/usr/bin/env node
2
+ require('../dist/cli');
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.0
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.1
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
9
 
10
10
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
11
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -17,7 +17,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
17
17
  // <define:__STANDARD_RULES>
18
18
  var define_STANDARD_RULES_default = { "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-magic-numbers": ["off"], "no-unused-expressions": ["off"], "no-unused-vars": ["off"], "no-use-before-define": ["off"], "no-useless-constructor": ["off"], "prefer-destructuring": ["off"], "prefer-promise-reject-errors": ["off"], "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-native-nonconstructor": ["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-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"], "@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-literal-property-style": ["error", "fields"], "@typescript-eslint/class-methods-use-this": ["error", { exceptMethods: [], enforceForClassFields: true, ignoreOverrideMethods: false, ignoreClassesThatImplementAnInterface: false }], "@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-deprecated": ["warn"], "@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-empty-object-type": ["error", { allowInterfaces: "with-single-extends", allowObjectTypes: "never" }], "@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-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-magic-numbers": ["error", { ignore: [], ignoreArrayIndexes: false, ignoreDefaultValues: false, ignoreClassFieldInitialValues: false, enforceConst: false, detectObjects: true, ignoreEnums: true, ignoreNumericLiteralTypes: false, ignoreReadonlyClassProperties: true, ignoreTypeIndexes: false }], "@typescript-eslint/no-meaningless-void-operator": ["error", { checkNever: true }], "@typescript-eslint/no-misused-new": ["error"], "@typescript-eslint/no-misused-promises": ["error"], "@typescript-eslint/no-mixed-enums": ["error"], "@typescript-eslint/no-namespace": ["error"], "@typescript-eslint/no-non-null-asserted-nullish-coalescing": ["error"], "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], "@typescript-eslint/no-non-null-assertion": ["error"], "@typescript-eslint/no-redundant-type-constituents": ["error"], "@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-condition": ["error", { allowConstantLoopConditions: true }], "@typescript-eslint/no-unnecessary-parameter-property-assignment": ["error"], "@typescript-eslint/no-unnecessary-qualifier": ["error"], "@typescript-eslint/no-unnecessary-template-expression": ["error"], "@typescript-eslint/no-unnecessary-type-arguments": ["error"], "@typescript-eslint/no-unnecessary-type-assertion": ["error"], "@typescript-eslint/no-unnecessary-type-constraint": ["error"], "@typescript-eslint/no-unnecessary-type-parameters": ["error"], "@typescript-eslint/no-unsafe-argument": ["error"], "@typescript-eslint/no-unsafe-assignment": ["error"], "@typescript-eslint/no-unsafe-call": ["error"], "@typescript-eslint/no-unsafe-declaration-merging": ["error"], "@typescript-eslint/no-unsafe-enum-comparison": ["error"], "@typescript-eslint/no-unsafe-function-type": ["error"], "@typescript-eslint/no-unsafe-member-access": ["error"], "@typescript-eslint/no-unsafe-return": ["error"], "@typescript-eslint/no-unsafe-unary-minus": ["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-useless-empty-export": ["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-as-const": ["error"], "@typescript-eslint/prefer-destructuring": ["error", { array: true, object: true }, { enforceForRenamedProperties: true, enforceForDeclarationWithTypeAnnotation: 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 }] };
19
19
 
20
- // ../../node_modules/.pnpm/tsup@8.4.0_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.7.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
20
+ // ../../node_modules/.pnpm/tsup@8.4.0_jiti@2.4.2_postc_f8bfeb2bd6bc12891f26d321a609b27e/node_modules/tsup/assets/esm_shims.js
21
21
  import { fileURLToPath } from "url";
22
22
  import path from "path";
23
23
  var getFilename = () => fileURLToPath(import.meta.url);
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.0
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.1
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
9
 
10
10
  "use strict";
11
11
  var __create = Object.create;
package/dist/cli.mjs CHANGED
@@ -1,16 +1,16 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.0
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.1
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
9
 
10
10
  import {
11
11
  CLI_NAME,
12
12
  __require
13
- } from "./chunk-NVFPC5RO.mjs";
13
+ } from "./chunk-S6JKNAIM.mjs";
14
14
 
15
15
  // src/cli/index.ts
16
16
  import yargs from "yargs";
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.0
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.1
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
9
 
10
10
  "use strict";
11
11
  var __create = Object.create;
@@ -49,7 +49,7 @@ var define_STANDARD_RULES_default = { "class-methods-use-this": ["off"], "dot-no
49
49
  // src/factory/index.ts
50
50
  var import_node_assert = __toESM(require("assert"));
51
51
  var import_node_url = require("url");
52
- var import_node_path3 = __toESM(require("path"));
52
+ var import_node_path2 = __toESM(require("path"));
53
53
  var parserTs = __toESM(require("@typescript-eslint/parser"));
54
54
  var parserVue = __toESM(require("vue-eslint-parser"));
55
55
  var import_eslint_utils3 = require("@agilebot/eslint-utils");
@@ -238,6 +238,7 @@ var pluginTs2 = __toESM(require("@typescript-eslint/eslint-plugin"));
238
238
  var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"));
239
239
  var import_eslint_plugin_prefer_arrow_functions = __toESM(require("eslint-plugin-prefer-arrow-functions"));
240
240
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"));
241
+ var import_eslint_plugin_react_edge = __toESM(require("eslint-plugin-react-edge"));
241
242
  var import_eslint_utils = require("@agilebot/eslint-utils");
242
243
  function ts() {
243
244
  return {
@@ -247,7 +248,8 @@ function ts() {
247
248
  "@typescript-eslint": pluginTs2,
248
249
  "@stylistic": import_eslint_plugin2.default,
249
250
  "prefer-arrow-functions": import_eslint_plugin_prefer_arrow_functions.default,
250
- "unused-imports": import_eslint_plugin_unused_imports.default
251
+ "unused-imports": import_eslint_plugin_unused_imports.default,
252
+ "react-edge": import_eslint_plugin_react_edge.default
251
253
  },
252
254
  rules: {
253
255
  // 如果没用模板字符串,避免使用反引号
@@ -337,7 +339,8 @@ function ts() {
337
339
  checksVoidReturn: false
338
340
  }
339
341
  ],
340
- "@typescript-eslint/no-deprecated": "error"
342
+ "@typescript-eslint/no-deprecated": "error",
343
+ "react-edge/var-naming": "error"
341
344
  }
342
345
  };
343
346
  }
@@ -549,6 +552,7 @@ var import_eslint_plugin3 = __toESM(require("@eslint-react/eslint-plugin"));
549
552
  var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"));
550
553
  var import_eslint_plugin_jsx_a11y = __toESM(require("eslint-plugin-jsx-a11y"));
551
554
  var import_eslint_plugin4 = __toESM(require("@stylistic/eslint-plugin"));
555
+ var import_eslint_plugin_react_edge2 = __toESM(require("eslint-plugin-react-edge"));
552
556
  var import_eslint_plugin5 = __toESM(require("@agilebot/eslint-plugin"));
553
557
  function react(opts) {
554
558
  return {
@@ -560,7 +564,8 @@ function react(opts) {
560
564
  "jsx-a11y": import_eslint_plugin_jsx_a11y.default,
561
565
  ...import_eslint_plugin3.default.configs.recommended.plugins,
562
566
  "@stylistic": import_eslint_plugin4.default,
563
- "@agilebot": import_eslint_plugin5.default
567
+ "@agilebot": import_eslint_plugin5.default,
568
+ "react-edge": import_eslint_plugin_react_edge2.default
564
569
  },
565
570
  rules: {
566
571
  ...import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules,
@@ -649,7 +654,8 @@ function react(opts) {
649
654
  ],
650
655
  "jsx-a11y/click-events-have-key-events": "off",
651
656
  "jsx-a11y/no-static-element-interactions": "off",
652
- "jsx-a11y/alt-text": "off"
657
+ "jsx-a11y/alt-text": "off",
658
+ "react-edge/prefer-named-property-access": "error"
653
659
  },
654
660
  settings: {
655
661
  react: {
@@ -720,139 +726,14 @@ function jsdoc(opt) {
720
726
 
721
727
  // src/configs/lodash.ts
722
728
  var import_eslint_plugin_you_dont_need_lodash_underscore = __toESM(require("eslint-plugin-you-dont-need-lodash-underscore"));
723
-
724
- // ../../node_modules/.pnpm/@eslint+compat@1.2.7_eslint@9.21.0_jiti@2.4.2_/node_modules/@eslint/compat/dist/esm/index.js
725
- var import_node_fs2 = __toESM(require("fs"), 1);
726
- var import_node_path2 = __toESM(require("path"), 1);
727
- var removedMethodNames = /* @__PURE__ */ new Map([
728
- ["getSource", "getText"],
729
- ["getSourceLines", "getLines"],
730
- ["getAllComments", "getAllComments"],
731
- ["getDeclaredVariables", "getDeclaredVariables"],
732
- ["getNodeByRangeIndex", "getNodeByRangeIndex"],
733
- ["getCommentsBefore", "getCommentsBefore"],
734
- ["getCommentsAfter", "getCommentsAfter"],
735
- ["getCommentsInside", "getCommentsInside"],
736
- ["getJSDocComment", "getJSDocComment"],
737
- ["getFirstToken", "getFirstToken"],
738
- ["getFirstTokens", "getFirstTokens"],
739
- ["getLastToken", "getLastToken"],
740
- ["getLastTokens", "getLastTokens"],
741
- ["getTokenAfter", "getTokenAfter"],
742
- ["getTokenBefore", "getTokenBefore"],
743
- ["getTokenByRangeStart", "getTokenByRangeStart"],
744
- ["getTokens", "getTokens"],
745
- ["getTokensAfter", "getTokensAfter"],
746
- ["getTokensBefore", "getTokensBefore"],
747
- ["getTokensBetween", "getTokensBetween"]
748
- ]);
749
- var fixedUpRuleReplacements = /* @__PURE__ */ new WeakMap();
750
- var fixedUpRules = /* @__PURE__ */ new WeakSet();
751
- var fixedUpPluginReplacements = /* @__PURE__ */ new WeakMap();
752
- var fixedUpPlugins = /* @__PURE__ */ new WeakSet();
753
- function fixupRule(ruleDefinition) {
754
- if (fixedUpRuleReplacements.has(ruleDefinition)) {
755
- return fixedUpRuleReplacements.get(ruleDefinition);
756
- }
757
- const isLegacyRule = typeof ruleDefinition === "function";
758
- if (!isLegacyRule && fixedUpRules.has(ruleDefinition)) {
759
- return ruleDefinition;
760
- }
761
- const originalCreate = isLegacyRule ? ruleDefinition : ruleDefinition.create.bind(ruleDefinition);
762
- function ruleCreate(context) {
763
- if ("getScope" in context) {
764
- return originalCreate(context);
765
- }
766
- const sourceCode = context.sourceCode;
767
- let currentNode = sourceCode.ast;
768
- const newContext = Object.assign(Object.create(context), {
769
- parserServices: sourceCode.parserServices,
770
- /*
771
- * The following methods rely on the current node in the traversal,
772
- * so we need to add them manually.
773
- */
774
- getScope() {
775
- return sourceCode.getScope(currentNode);
776
- },
777
- getAncestors() {
778
- return sourceCode.getAncestors(currentNode);
779
- },
780
- markVariableAsUsed(variable) {
781
- sourceCode.markVariableAsUsed(variable, currentNode);
782
- }
783
- });
784
- for (const [
785
- contextMethodName,
786
- sourceCodeMethodName
787
- ] of removedMethodNames) {
788
- newContext[contextMethodName] = sourceCode[sourceCodeMethodName].bind(sourceCode);
789
- }
790
- Object.freeze(newContext);
791
- const visitor = originalCreate(newContext);
792
- for (const [methodName, method] of Object.entries(visitor)) {
793
- if (methodName.startsWith("on")) {
794
- visitor[methodName] = (...args) => {
795
- currentNode = args[methodName === "onCodePathSegmentLoop" ? 2 : 1];
796
- return method.call(visitor, ...args);
797
- };
798
- continue;
799
- }
800
- visitor[methodName] = (...args) => {
801
- currentNode = args[0];
802
- return method.call(visitor, ...args);
803
- };
804
- }
805
- return visitor;
806
- }
807
- const newRuleDefinition = {
808
- ...isLegacyRule ? void 0 : ruleDefinition,
809
- create: ruleCreate
810
- };
811
- const { schema } = ruleDefinition;
812
- if (schema) {
813
- if (!newRuleDefinition.meta) {
814
- newRuleDefinition.meta = { schema };
815
- } else {
816
- newRuleDefinition.meta = {
817
- ...newRuleDefinition.meta,
818
- // top-level `schema` had precedence over `meta.schema` so it's okay to overwrite `meta.schema` if it exists
819
- schema
820
- };
821
- }
822
- }
823
- fixedUpRuleReplacements.set(ruleDefinition, newRuleDefinition);
824
- fixedUpRules.add(newRuleDefinition);
825
- return newRuleDefinition;
826
- }
827
- function fixupPluginRules(plugin) {
828
- if (fixedUpPluginReplacements.has(plugin)) {
829
- return fixedUpPluginReplacements.get(plugin);
830
- }
831
- if (fixedUpPlugins.has(plugin) || !plugin.rules) {
832
- return plugin;
833
- }
834
- const newPlugin = {
835
- ...plugin,
836
- rules: Object.fromEntries(
837
- Object.entries(plugin.rules).map(([ruleId, ruleDefinition]) => [
838
- ruleId,
839
- fixupRule(ruleDefinition)
840
- ])
841
- )
842
- };
843
- fixedUpPluginReplacements.set(plugin, newPlugin);
844
- fixedUpPlugins.add(newPlugin);
845
- return newPlugin;
846
- }
847
-
848
- // src/configs/lodash.ts
729
+ var import_compat = require("@eslint/compat");
849
730
  function lodash() {
850
731
  return {
851
732
  // lodash一些方法可能影响性能,如forEach等,优先使用js的原生方法
852
733
  name: "agilebot/lodash",
853
734
  files: DEFAULT_GLOBS,
854
735
  plugins: {
855
- "you-dont-need-lodash-underscore": fixupPluginRules(import_eslint_plugin_you_dont_need_lodash_underscore.default)
736
+ "you-dont-need-lodash-underscore": (0, import_compat.fixupPluginRules)(import_eslint_plugin_you_dont_need_lodash_underscore.default)
856
737
  },
857
738
  rules: {
858
739
  ...import_eslint_plugin_you_dont_need_lodash_underscore.default.configs["all-warn"].rules,
@@ -1032,7 +913,7 @@ function factory(root, options) {
1032
913
  if (typeof root === "string") {
1033
914
  rootDir = root;
1034
915
  } else if (root?.url) {
1035
- rootDir = import_node_path3.default.dirname((0, import_node_url.fileURLToPath)(root.url));
916
+ rootDir = import_node_path2.default.dirname((0, import_node_url.fileURLToPath)(root.url));
1036
917
  } else {
1037
918
  throw new Error("root must be a string or ImportMeta");
1038
919
  }
@@ -1192,7 +1073,7 @@ function factory(root, options) {
1192
1073
  agilebot
1193
1074
  });
1194
1075
  /**
1195
- * @license @agilebot/prettier-config v0.8.0
1076
+ * @license @agilebot/prettier-config v0.8.1
1196
1077
  *
1197
1078
  * Copyright (c) Agilebot, Inc. and its affiliates.
1198
1079
  *
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.0
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.1
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
9
 
10
10
  import {
11
11
  DEFAULT_GLOBS,
@@ -16,7 +16,7 @@ import {
16
16
  VUE_GLOBS,
17
17
  __dirname,
18
18
  define_STANDARD_RULES_default
19
- } from "./chunk-NVFPC5RO.mjs";
19
+ } from "./chunk-S6JKNAIM.mjs";
20
20
 
21
21
  // src/factory/index.ts
22
22
  import assert from "node:assert";
@@ -163,6 +163,7 @@ import * as pluginTs2 from "@typescript-eslint/eslint-plugin";
163
163
  import pluginStylistic from "@stylistic/eslint-plugin";
164
164
  import pluginPreferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
165
165
  import pluginUnusedImports from "eslint-plugin-unused-imports";
166
+ import pluginReactEdge from "eslint-plugin-react-edge";
166
167
  import { isInEditor } from "@agilebot/eslint-utils";
167
168
  function ts() {
168
169
  return {
@@ -172,7 +173,8 @@ function ts() {
172
173
  "@typescript-eslint": pluginTs2,
173
174
  "@stylistic": pluginStylistic,
174
175
  "prefer-arrow-functions": pluginPreferArrowFunctions,
175
- "unused-imports": pluginUnusedImports
176
+ "unused-imports": pluginUnusedImports,
177
+ "react-edge": pluginReactEdge
176
178
  },
177
179
  rules: {
178
180
  // 如果没用模板字符串,避免使用反引号
@@ -262,7 +264,8 @@ function ts() {
262
264
  checksVoidReturn: false
263
265
  }
264
266
  ],
265
- "@typescript-eslint/no-deprecated": "error"
267
+ "@typescript-eslint/no-deprecated": "error",
268
+ "react-edge/var-naming": "error"
266
269
  }
267
270
  };
268
271
  }
@@ -474,6 +477,7 @@ import pluginReactX from "@eslint-react/eslint-plugin";
474
477
  import pluginReactHooks from "eslint-plugin-react-hooks";
475
478
  import pluginJsxA11y from "eslint-plugin-jsx-a11y";
476
479
  import pluginStylistic2 from "@stylistic/eslint-plugin";
480
+ import pluginReactEdge2 from "eslint-plugin-react-edge";
477
481
  import pluginAgilebot from "@agilebot/eslint-plugin";
478
482
  function react(opts) {
479
483
  return {
@@ -485,7 +489,8 @@ function react(opts) {
485
489
  "jsx-a11y": pluginJsxA11y,
486
490
  ...pluginReactX.configs.recommended.plugins,
487
491
  "@stylistic": pluginStylistic2,
488
- "@agilebot": pluginAgilebot
492
+ "@agilebot": pluginAgilebot,
493
+ "react-edge": pluginReactEdge2
489
494
  },
490
495
  rules: {
491
496
  ...pluginJsxA11y.flatConfigs.recommended.rules,
@@ -574,7 +579,8 @@ function react(opts) {
574
579
  ],
575
580
  "jsx-a11y/click-events-have-key-events": "off",
576
581
  "jsx-a11y/no-static-element-interactions": "off",
577
- "jsx-a11y/alt-text": "off"
582
+ "jsx-a11y/alt-text": "off",
583
+ "react-edge/prefer-named-property-access": "error"
578
584
  },
579
585
  settings: {
580
586
  react: {
@@ -645,130 +651,7 @@ function jsdoc(opt) {
645
651
 
646
652
  // src/configs/lodash.ts
647
653
  import pluginLodash from "eslint-plugin-you-dont-need-lodash-underscore";
648
-
649
- // ../../node_modules/.pnpm/@eslint+compat@1.2.7_eslint@9.21.0_jiti@2.4.2_/node_modules/@eslint/compat/dist/esm/index.js
650
- var removedMethodNames = /* @__PURE__ */ new Map([
651
- ["getSource", "getText"],
652
- ["getSourceLines", "getLines"],
653
- ["getAllComments", "getAllComments"],
654
- ["getDeclaredVariables", "getDeclaredVariables"],
655
- ["getNodeByRangeIndex", "getNodeByRangeIndex"],
656
- ["getCommentsBefore", "getCommentsBefore"],
657
- ["getCommentsAfter", "getCommentsAfter"],
658
- ["getCommentsInside", "getCommentsInside"],
659
- ["getJSDocComment", "getJSDocComment"],
660
- ["getFirstToken", "getFirstToken"],
661
- ["getFirstTokens", "getFirstTokens"],
662
- ["getLastToken", "getLastToken"],
663
- ["getLastTokens", "getLastTokens"],
664
- ["getTokenAfter", "getTokenAfter"],
665
- ["getTokenBefore", "getTokenBefore"],
666
- ["getTokenByRangeStart", "getTokenByRangeStart"],
667
- ["getTokens", "getTokens"],
668
- ["getTokensAfter", "getTokensAfter"],
669
- ["getTokensBefore", "getTokensBefore"],
670
- ["getTokensBetween", "getTokensBetween"]
671
- ]);
672
- var fixedUpRuleReplacements = /* @__PURE__ */ new WeakMap();
673
- var fixedUpRules = /* @__PURE__ */ new WeakSet();
674
- var fixedUpPluginReplacements = /* @__PURE__ */ new WeakMap();
675
- var fixedUpPlugins = /* @__PURE__ */ new WeakSet();
676
- function fixupRule(ruleDefinition) {
677
- if (fixedUpRuleReplacements.has(ruleDefinition)) {
678
- return fixedUpRuleReplacements.get(ruleDefinition);
679
- }
680
- const isLegacyRule = typeof ruleDefinition === "function";
681
- if (!isLegacyRule && fixedUpRules.has(ruleDefinition)) {
682
- return ruleDefinition;
683
- }
684
- const originalCreate = isLegacyRule ? ruleDefinition : ruleDefinition.create.bind(ruleDefinition);
685
- function ruleCreate(context) {
686
- if ("getScope" in context) {
687
- return originalCreate(context);
688
- }
689
- const sourceCode = context.sourceCode;
690
- let currentNode = sourceCode.ast;
691
- const newContext = Object.assign(Object.create(context), {
692
- parserServices: sourceCode.parserServices,
693
- /*
694
- * The following methods rely on the current node in the traversal,
695
- * so we need to add them manually.
696
- */
697
- getScope() {
698
- return sourceCode.getScope(currentNode);
699
- },
700
- getAncestors() {
701
- return sourceCode.getAncestors(currentNode);
702
- },
703
- markVariableAsUsed(variable) {
704
- sourceCode.markVariableAsUsed(variable, currentNode);
705
- }
706
- });
707
- for (const [
708
- contextMethodName,
709
- sourceCodeMethodName
710
- ] of removedMethodNames) {
711
- newContext[contextMethodName] = sourceCode[sourceCodeMethodName].bind(sourceCode);
712
- }
713
- Object.freeze(newContext);
714
- const visitor = originalCreate(newContext);
715
- for (const [methodName, method] of Object.entries(visitor)) {
716
- if (methodName.startsWith("on")) {
717
- visitor[methodName] = (...args) => {
718
- currentNode = args[methodName === "onCodePathSegmentLoop" ? 2 : 1];
719
- return method.call(visitor, ...args);
720
- };
721
- continue;
722
- }
723
- visitor[methodName] = (...args) => {
724
- currentNode = args[0];
725
- return method.call(visitor, ...args);
726
- };
727
- }
728
- return visitor;
729
- }
730
- const newRuleDefinition = {
731
- ...isLegacyRule ? void 0 : ruleDefinition,
732
- create: ruleCreate
733
- };
734
- const { schema } = ruleDefinition;
735
- if (schema) {
736
- if (!newRuleDefinition.meta) {
737
- newRuleDefinition.meta = { schema };
738
- } else {
739
- newRuleDefinition.meta = {
740
- ...newRuleDefinition.meta,
741
- // top-level `schema` had precedence over `meta.schema` so it's okay to overwrite `meta.schema` if it exists
742
- schema
743
- };
744
- }
745
- }
746
- fixedUpRuleReplacements.set(ruleDefinition, newRuleDefinition);
747
- fixedUpRules.add(newRuleDefinition);
748
- return newRuleDefinition;
749
- }
750
- function fixupPluginRules(plugin) {
751
- if (fixedUpPluginReplacements.has(plugin)) {
752
- return fixedUpPluginReplacements.get(plugin);
753
- }
754
- if (fixedUpPlugins.has(plugin) || !plugin.rules) {
755
- return plugin;
756
- }
757
- const newPlugin = {
758
- ...plugin,
759
- rules: Object.fromEntries(
760
- Object.entries(plugin.rules).map(([ruleId, ruleDefinition]) => [
761
- ruleId,
762
- fixupRule(ruleDefinition)
763
- ])
764
- )
765
- };
766
- fixedUpPluginReplacements.set(plugin, newPlugin);
767
- fixedUpPlugins.add(newPlugin);
768
- return newPlugin;
769
- }
770
-
771
- // src/configs/lodash.ts
654
+ import { fixupPluginRules } from "@eslint/compat";
772
655
  function lodash() {
773
656
  return {
774
657
  // lodash一些方法可能影响性能,如forEach等,优先使用js的原生方法
@@ -1114,7 +997,7 @@ export {
1114
997
  factory as agilebot
1115
998
  };
1116
999
  /**
1117
- * @license @agilebot/prettier-config v0.8.0
1000
+ * @license @agilebot/prettier-config v0.8.1
1118
1001
  *
1119
1002
  * Copyright (c) Agilebot, Inc. and its affiliates.
1120
1003
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "bin": {
6
6
  "eslint-agilebot": "bin/eslint-agilebot"
@@ -29,6 +29,7 @@
29
29
  "@cspell/eslint-plugin": "^8.17.5",
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
31
31
  "@eslint-react/eslint-plugin": "^1.29.0",
32
+ "@eslint/compat": "^1.2.7",
32
33
  "@eslint/js": "^9.21.0",
33
34
  "@stylistic/eslint-plugin": "^4.1.0",
34
35
  "@typescript-eslint/eslint-plugin": "~8.25.0",
@@ -49,6 +50,7 @@
49
50
  "eslint-plugin-prettier": "^5.2.1",
50
51
  "eslint-plugin-promise": "^7.2.1",
51
52
  "eslint-plugin-react": "^7.37.2",
53
+ "eslint-plugin-react-edge": "^0.1.1",
52
54
  "eslint-plugin-react-hooks": "^5.0.0",
53
55
  "eslint-plugin-unicorn": "^56.0.1",
54
56
  "eslint-plugin-unused-imports": "^4.1.4",
@@ -58,7 +60,7 @@
58
60
  "globals": "^16.0.0",
59
61
  "vue-eslint-parser": "^9.4.3",
60
62
  "yargs": "^17.7.2",
61
- "@agilebot/eslint-utils": "0.8.0"
63
+ "@agilebot/eslint-utils": "0.8.1"
62
64
  },
63
65
  "devDependencies": {
64
66
  "@types/yargs": "^17.0.33",
@@ -66,7 +68,7 @@
66
68
  },
67
69
  "peerDependencies": {
68
70
  "eslint": "^8.57.0 || ^9.0.0",
69
- "@agilebot/eslint-plugin": "0.8.0"
71
+ "@agilebot/eslint-plugin": "0.8.1"
70
72
  },
71
73
  "files": [
72
74
  "bin",