@agilebot/eslint-config 0.7.0-beta.2 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
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.
package/LICENSE.tpl CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * @license %(name)s v%(version)s
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 %(name)s v%(version)s
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 +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.7.0-beta.2
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.7.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.3.5_jiti@2.3.3_postcss@8.4.47_tsx@4.19.2_typescript@5.5.4_yaml@2.6.1/node_modules/tsup/assets/esm_shims.js
20
+ // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.6.1/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.7.0-beta.2
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.7.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.7.0-beta.2
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.7.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-6UXOQCYC.mjs";
13
+ } from "./chunk-MQP5VK72.mjs";
14
14
 
15
15
  // src/cli/index.ts
16
16
  import { isCI } from "@agilebot/eslint-utils";
package/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ interface FactoryOptions {
14
14
  * ESLint configuration
15
15
  * @default undefined
16
16
  */
17
- config?: FlatConfigItem;
17
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
18
18
  /**
19
19
  * List of files to ignore
20
20
  * @default undefined
@@ -86,6 +86,6 @@ interface FactoryOptions {
86
86
  importResolver?: 'typescript' | 'oxc';
87
87
  }
88
88
 
89
- declare function factory(root: string, options?: FactoryOptions): FlatConfigItem[];
89
+ declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
90
90
 
91
91
  export { factory as agilebot };
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ interface FactoryOptions {
14
14
  * ESLint configuration
15
15
  * @default undefined
16
16
  */
17
- config?: FlatConfigItem;
17
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
18
18
  /**
19
19
  * List of files to ignore
20
20
  * @default undefined
@@ -86,6 +86,6 @@ interface FactoryOptions {
86
86
  importResolver?: 'typescript' | 'oxc';
87
87
  }
88
88
 
89
- declare function factory(root: string, options?: FactoryOptions): FlatConfigItem[];
89
+ declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
90
90
 
91
91
  export { factory as agilebot };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.2
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.7.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;
@@ -48,6 +48,8 @@ var define_STANDARD_RULES_default = { "class-methods-use-this": ["off"], "dot-no
48
48
 
49
49
  // src/factory/index.ts
50
50
  var import_node_assert = __toESM(require("assert"));
51
+ var import_node_url = require("url");
52
+ var import_node_path3 = __toESM(require("path"));
51
53
  var import_eslint_utils3 = require("@agilebot/eslint-utils");
52
54
  var parserTs = __toESM(require("@typescript-eslint/parser"));
53
55
  var parserVue = __toESM(require("vue-eslint-parser"));
@@ -637,7 +639,6 @@ function react(opts) {
637
639
  checkLocalVariables: true
638
640
  }
639
641
  ],
640
- "react/no-unused-prop-types": "error",
641
642
  // Stylistic rules are not supported by @eslint-react. Use dprint or @stylistic instead.
642
643
  "@stylistic/jsx-self-closing-comp": "error",
643
644
  // <App prop={'Hello'} />没必要,使用<App prop="Hello" />
@@ -1012,7 +1013,13 @@ function godaddy() {
1012
1013
  // src/factory/index.ts
1013
1014
  function factory(root, options) {
1014
1015
  import_node_assert.default.ok(root, "root option is required");
1015
- const tsconfigFiles = (0, import_eslint_utils3.findTsconfigFiles)(root, {
1016
+ let rootDir;
1017
+ if (typeof root === "string") {
1018
+ rootDir = root;
1019
+ } else {
1020
+ rootDir = import_node_path3.default.dirname((0, import_node_url.fileURLToPath)(root.url));
1021
+ }
1022
+ const tsconfigFiles = (0, import_eslint_utils3.findTsconfigFiles)(rootDir, {
1016
1023
  absolute: true
1017
1024
  });
1018
1025
  const defaultOptions = {
@@ -1027,7 +1034,7 @@ function factory(root, options) {
1027
1034
  ...defaultOptions,
1028
1035
  ...options
1029
1036
  };
1030
- if (options?.config) {
1037
+ if (options.config) {
1031
1038
  import_node_assert.default.ok(
1032
1039
  Object.keys(options.config).every(
1033
1040
  (key) => key === "rules" || key === "settings"
@@ -1037,18 +1044,18 @@ function factory(root, options) {
1037
1044
  }
1038
1045
  const commonConfigs = [
1039
1046
  unicorn({
1040
- module: options?.module ?? false
1047
+ module: options.module ?? false
1041
1048
  }),
1042
1049
  comments()
1043
1050
  ];
1044
1051
  if (options.import) {
1045
1052
  commonConfigs.push(
1046
1053
  imports({
1047
- packageDir: root,
1048
- devDependencies: options?.devDependencies,
1049
- monorepoScope: options?.monorepoScope,
1050
- coreModules: options?.coreModules,
1051
- resolver: options?.importResolver
1054
+ packageDir: rootDir,
1055
+ devDependencies: options.devDependencies,
1056
+ monorepoScope: options.monorepoScope,
1057
+ coreModules: options.coreModules,
1058
+ resolver: options.importResolver
1052
1059
  })
1053
1060
  );
1054
1061
  }
@@ -1077,9 +1084,6 @@ function factory(root, options) {
1077
1084
  }
1078
1085
  config.push(...commonConfigs);
1079
1086
  config.push(godaddy());
1080
- if (options.config) {
1081
- config.push(options.config);
1082
- }
1083
1087
  } else {
1084
1088
  config.push({
1085
1089
  name: "agilebot/parser",
@@ -1095,7 +1099,7 @@ function factory(root, options) {
1095
1099
  jsx: true
1096
1100
  },
1097
1101
  sourceType: options.module ? "module" : void 0,
1098
- extraFileExtensions: !options?.vue ? void 0 : [".vue"]
1102
+ extraFileExtensions: !options.vue ? void 0 : [".vue"]
1099
1103
  }
1100
1104
  }
1101
1105
  });
@@ -1139,13 +1143,17 @@ function factory(root, options) {
1139
1143
  config.push(...commonConfigs);
1140
1144
  config.push(
1141
1145
  agilebot({
1142
- root,
1143
- monorepoScope: options?.monorepoScope
1146
+ root: rootDir,
1147
+ monorepoScope: options.monorepoScope
1144
1148
  })
1145
1149
  );
1146
- if (options.config) {
1147
- config.push(options.config);
1148
- }
1150
+ }
1151
+ if (options.config) {
1152
+ config.push({
1153
+ name: "agilebot/custom",
1154
+ files: DEFAULT_GLOBS,
1155
+ ...options.config
1156
+ });
1149
1157
  }
1150
1158
  config.push({
1151
1159
  name: "agilebot/ignores",
@@ -1158,7 +1166,11 @@ function factory(root, options) {
1158
1166
  delete configItem.plugins;
1159
1167
  }
1160
1168
  });
1161
- config[0].plugins = allPlugins;
1169
+ config.unshift({
1170
+ name: "agilebot/plugins",
1171
+ files: DEFAULT_GLOBS,
1172
+ plugins: allPlugins
1173
+ });
1162
1174
  return config;
1163
1175
  }
1164
1176
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.2
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.7.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,10 +16,12 @@ import {
16
16
  VUE_GLOBS,
17
17
  __dirname,
18
18
  define_STANDARD_RULES_default
19
- } from "./chunk-6UXOQCYC.mjs";
19
+ } from "./chunk-MQP5VK72.mjs";
20
20
 
21
21
  // src/factory/index.ts
22
22
  import assert from "node:assert";
23
+ import { fileURLToPath } from "node:url";
24
+ import path2 from "node:path";
23
25
  import { findTsconfigFiles } from "@agilebot/eslint-utils";
24
26
  import * as parserTs from "@typescript-eslint/parser";
25
27
  import * as parserVue from "vue-eslint-parser";
@@ -562,7 +564,6 @@ function react(opts) {
562
564
  checkLocalVariables: true
563
565
  }
564
566
  ],
565
- "react/no-unused-prop-types": "error",
566
567
  // Stylistic rules are not supported by @eslint-react. Use dprint or @stylistic instead.
567
568
  "@stylistic/jsx-self-closing-comp": "error",
568
569
  // <App prop={'Hello'} />没必要,使用<App prop="Hello" />
@@ -935,7 +936,13 @@ function godaddy() {
935
936
  // src/factory/index.ts
936
937
  function factory(root, options) {
937
938
  assert.ok(root, "root option is required");
938
- const tsconfigFiles = findTsconfigFiles(root, {
939
+ let rootDir;
940
+ if (typeof root === "string") {
941
+ rootDir = root;
942
+ } else {
943
+ rootDir = path2.dirname(fileURLToPath(root.url));
944
+ }
945
+ const tsconfigFiles = findTsconfigFiles(rootDir, {
939
946
  absolute: true
940
947
  });
941
948
  const defaultOptions = {
@@ -950,7 +957,7 @@ function factory(root, options) {
950
957
  ...defaultOptions,
951
958
  ...options
952
959
  };
953
- if (options?.config) {
960
+ if (options.config) {
954
961
  assert.ok(
955
962
  Object.keys(options.config).every(
956
963
  (key) => key === "rules" || key === "settings"
@@ -960,18 +967,18 @@ function factory(root, options) {
960
967
  }
961
968
  const commonConfigs = [
962
969
  unicorn({
963
- module: options?.module ?? false
970
+ module: options.module ?? false
964
971
  }),
965
972
  comments()
966
973
  ];
967
974
  if (options.import) {
968
975
  commonConfigs.push(
969
976
  imports({
970
- packageDir: root,
971
- devDependencies: options?.devDependencies,
972
- monorepoScope: options?.monorepoScope,
973
- coreModules: options?.coreModules,
974
- resolver: options?.importResolver
977
+ packageDir: rootDir,
978
+ devDependencies: options.devDependencies,
979
+ monorepoScope: options.monorepoScope,
980
+ coreModules: options.coreModules,
981
+ resolver: options.importResolver
975
982
  })
976
983
  );
977
984
  }
@@ -1000,9 +1007,6 @@ function factory(root, options) {
1000
1007
  }
1001
1008
  config.push(...commonConfigs);
1002
1009
  config.push(godaddy());
1003
- if (options.config) {
1004
- config.push(options.config);
1005
- }
1006
1010
  } else {
1007
1011
  config.push({
1008
1012
  name: "agilebot/parser",
@@ -1018,7 +1022,7 @@ function factory(root, options) {
1018
1022
  jsx: true
1019
1023
  },
1020
1024
  sourceType: options.module ? "module" : void 0,
1021
- extraFileExtensions: !options?.vue ? void 0 : [".vue"]
1025
+ extraFileExtensions: !options.vue ? void 0 : [".vue"]
1022
1026
  }
1023
1027
  }
1024
1028
  });
@@ -1062,13 +1066,17 @@ function factory(root, options) {
1062
1066
  config.push(...commonConfigs);
1063
1067
  config.push(
1064
1068
  agilebot({
1065
- root,
1066
- monorepoScope: options?.monorepoScope
1069
+ root: rootDir,
1070
+ monorepoScope: options.monorepoScope
1067
1071
  })
1068
1072
  );
1069
- if (options.config) {
1070
- config.push(options.config);
1071
- }
1073
+ }
1074
+ if (options.config) {
1075
+ config.push({
1076
+ name: "agilebot/custom",
1077
+ files: DEFAULT_GLOBS,
1078
+ ...options.config
1079
+ });
1072
1080
  }
1073
1081
  config.push({
1074
1082
  name: "agilebot/ignores",
@@ -1081,7 +1089,11 @@ function factory(root, options) {
1081
1089
  delete configItem.plugins;
1082
1090
  }
1083
1091
  });
1084
- config[0].plugins = allPlugins;
1092
+ config.unshift({
1093
+ name: "agilebot/plugins",
1094
+ files: DEFAULT_GLOBS,
1095
+ plugins: allPlugins
1096
+ });
1085
1097
  return config;
1086
1098
  }
1087
1099
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.7.0-beta.2",
3
+ "version": "0.7.1",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "bin": {
6
6
  "eslint-agilebot": "bin/eslint-agilebot"
@@ -28,18 +28,17 @@
28
28
  "dependencies": {
29
29
  "@cspell/eslint-plugin": "^8.16.0",
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
31
- "@eslint-react/eslint-plugin": "^1.16.2",
31
+ "@eslint-react/eslint-plugin": "^1.17.1",
32
32
  "@eslint/js": "^9.15.0",
33
33
  "@stylistic/eslint-plugin": "^2.11.0",
34
34
  "@typescript-eslint/eslint-plugin": "~8.15.0",
35
35
  "@typescript-eslint/parser": "~8.15.0",
36
- "add": "^2.0.6",
37
36
  "eslint-config-godaddy": "^6.0.0",
38
37
  "eslint-config-prettier": "^9.1.0",
39
38
  "eslint-import-resolver-oxc": "^0.4.0",
40
39
  "eslint-import-resolver-typescript": "^3.6.3",
41
40
  "eslint-plugin-file-progress": "^1.5.0",
42
- "eslint-plugin-import-x": "^4.4.2",
41
+ "eslint-plugin-import-x": "^4.4.3",
43
42
  "eslint-plugin-jsdoc": "^50.5.0",
44
43
  "eslint-plugin-jsx-a11y": "^6.10.2",
45
44
  "eslint-plugin-mocha": "^10.5.0",
@@ -59,7 +58,7 @@
59
58
  "picocolors": "^1.1.0",
60
59
  "vue-eslint-parser": "^9.4.3",
61
60
  "yargs": "^17.7.2",
62
- "@agilebot/eslint-utils": "0.7.0-beta.2"
61
+ "@agilebot/eslint-utils": "0.7.1"
63
62
  },
64
63
  "devDependencies": {
65
64
  "@types/yargs": "^17.0.33",
@@ -67,7 +66,7 @@
67
66
  },
68
67
  "peerDependencies": {
69
68
  "eslint": "^8.57.0 || ^9.0.0",
70
- "@agilebot/eslint-plugin": "0.7.0-beta.2"
69
+ "@agilebot/eslint-plugin": "0.7.1"
71
70
  },
72
71
  "files": [
73
72
  "bin",