@agilebot/eslint-config 0.7.0-beta.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -10,7 +10,7 @@ npm install --save-dev eslint \
10
10
  ```
11
11
 
12
12
  ```js
13
- // .eslintrc.js
13
+ // eslint.config.js
14
14
  const { agilebot } = require('@agilebot/eslint-config');
15
15
 
16
16
  module.exports = agilebot(__dirname);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.1
2
+ * @license @agilebot/eslint-config v0.7.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.1
2
+ * @license @agilebot/eslint-config v0.7.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.1
2
+ * @license @agilebot/eslint-config v0.7.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -10,7 +10,7 @@
10
10
  import {
11
11
  CLI_NAME,
12
12
  __require
13
- } from "./chunk-XQZGZMJY.mjs";
13
+ } from "./chunk-LC56YWFZ.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
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
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.1
2
+ * @license @agilebot/eslint-config v0.7.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -637,7 +637,6 @@ function react(opts) {
637
637
  checkLocalVariables: true
638
638
  }
639
639
  ],
640
- "react/no-unused-prop-types": "error",
641
640
  // Stylistic rules are not supported by @eslint-react. Use dprint or @stylistic instead.
642
641
  "@stylistic/jsx-self-closing-comp": "error",
643
642
  // <App prop={'Hello'} />没必要,使用<App prop="Hello" />
@@ -1027,7 +1026,7 @@ function factory(root, options) {
1027
1026
  ...defaultOptions,
1028
1027
  ...options
1029
1028
  };
1030
- if (options?.config) {
1029
+ if (options.config) {
1031
1030
  import_node_assert.default.ok(
1032
1031
  Object.keys(options.config).every(
1033
1032
  (key) => key === "rules" || key === "settings"
@@ -1037,7 +1036,7 @@ function factory(root, options) {
1037
1036
  }
1038
1037
  const commonConfigs = [
1039
1038
  unicorn({
1040
- module: options?.module ?? false
1039
+ module: options.module ?? false
1041
1040
  }),
1042
1041
  comments()
1043
1042
  ];
@@ -1045,10 +1044,10 @@ function factory(root, options) {
1045
1044
  commonConfigs.push(
1046
1045
  imports({
1047
1046
  packageDir: root,
1048
- devDependencies: options?.devDependencies,
1049
- monorepoScope: options?.monorepoScope,
1050
- coreModules: options?.coreModules,
1051
- resolver: options?.importResolver
1047
+ devDependencies: options.devDependencies,
1048
+ monorepoScope: options.monorepoScope,
1049
+ coreModules: options.coreModules,
1050
+ resolver: options.importResolver
1052
1051
  })
1053
1052
  );
1054
1053
  }
@@ -1077,9 +1076,6 @@ function factory(root, options) {
1077
1076
  }
1078
1077
  config.push(...commonConfigs);
1079
1078
  config.push(godaddy());
1080
- if (options.config) {
1081
- config.push(options.config);
1082
- }
1083
1079
  } else {
1084
1080
  config.push({
1085
1081
  name: "agilebot/parser",
@@ -1095,7 +1091,7 @@ function factory(root, options) {
1095
1091
  jsx: true
1096
1092
  },
1097
1093
  sourceType: options.module ? "module" : void 0,
1098
- extraFileExtensions: !options?.vue ? void 0 : [".vue"]
1094
+ extraFileExtensions: !options.vue ? void 0 : [".vue"]
1099
1095
  }
1100
1096
  }
1101
1097
  });
@@ -1140,29 +1136,33 @@ function factory(root, options) {
1140
1136
  config.push(
1141
1137
  agilebot({
1142
1138
  root,
1143
- monorepoScope: options?.monorepoScope
1139
+ monorepoScope: options.monorepoScope
1144
1140
  })
1145
1141
  );
1146
- if (options.config) {
1147
- config.push(options.config);
1148
- }
1142
+ }
1143
+ if (options.config) {
1144
+ config.push({
1145
+ name: "agilebot/custom",
1146
+ files: DEFAULT_GLOBS,
1147
+ ...options.config
1148
+ });
1149
1149
  }
1150
1150
  config.push({
1151
1151
  name: "agilebot/ignores",
1152
1152
  ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
1153
1153
  });
1154
- const includedPlugins = /* @__PURE__ */ new Set();
1154
+ const allPlugins = {};
1155
1155
  config.forEach((configItem) => {
1156
1156
  if (configItem.plugins) {
1157
- Object.keys(configItem.plugins).forEach((pluginName) => {
1158
- if (includedPlugins.has(pluginName)) {
1159
- delete configItem.plugins[pluginName];
1160
- } else {
1161
- includedPlugins.add(pluginName);
1162
- }
1163
- });
1157
+ Object.assign(allPlugins, configItem.plugins);
1158
+ delete configItem.plugins;
1164
1159
  }
1165
1160
  });
1161
+ config.unshift({
1162
+ name: "agilebot/plugins",
1163
+ files: DEFAULT_GLOBS,
1164
+ plugins: allPlugins
1165
+ });
1166
1166
  return config;
1167
1167
  }
1168
1168
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.0-beta.1
2
+ * @license @agilebot/eslint-config v0.7.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -16,7 +16,7 @@ import {
16
16
  VUE_GLOBS,
17
17
  __dirname,
18
18
  define_STANDARD_RULES_default
19
- } from "./chunk-XQZGZMJY.mjs";
19
+ } from "./chunk-LC56YWFZ.mjs";
20
20
 
21
21
  // src/factory/index.ts
22
22
  import assert from "node:assert";
@@ -562,7 +562,6 @@ function react(opts) {
562
562
  checkLocalVariables: true
563
563
  }
564
564
  ],
565
- "react/no-unused-prop-types": "error",
566
565
  // Stylistic rules are not supported by @eslint-react. Use dprint or @stylistic instead.
567
566
  "@stylistic/jsx-self-closing-comp": "error",
568
567
  // <App prop={'Hello'} />没必要,使用<App prop="Hello" />
@@ -950,7 +949,7 @@ function factory(root, options) {
950
949
  ...defaultOptions,
951
950
  ...options
952
951
  };
953
- if (options?.config) {
952
+ if (options.config) {
954
953
  assert.ok(
955
954
  Object.keys(options.config).every(
956
955
  (key) => key === "rules" || key === "settings"
@@ -960,7 +959,7 @@ function factory(root, options) {
960
959
  }
961
960
  const commonConfigs = [
962
961
  unicorn({
963
- module: options?.module ?? false
962
+ module: options.module ?? false
964
963
  }),
965
964
  comments()
966
965
  ];
@@ -968,10 +967,10 @@ function factory(root, options) {
968
967
  commonConfigs.push(
969
968
  imports({
970
969
  packageDir: root,
971
- devDependencies: options?.devDependencies,
972
- monorepoScope: options?.monorepoScope,
973
- coreModules: options?.coreModules,
974
- resolver: options?.importResolver
970
+ devDependencies: options.devDependencies,
971
+ monorepoScope: options.monorepoScope,
972
+ coreModules: options.coreModules,
973
+ resolver: options.importResolver
975
974
  })
976
975
  );
977
976
  }
@@ -1000,9 +999,6 @@ function factory(root, options) {
1000
999
  }
1001
1000
  config.push(...commonConfigs);
1002
1001
  config.push(godaddy());
1003
- if (options.config) {
1004
- config.push(options.config);
1005
- }
1006
1002
  } else {
1007
1003
  config.push({
1008
1004
  name: "agilebot/parser",
@@ -1018,7 +1014,7 @@ function factory(root, options) {
1018
1014
  jsx: true
1019
1015
  },
1020
1016
  sourceType: options.module ? "module" : void 0,
1021
- extraFileExtensions: !options?.vue ? void 0 : [".vue"]
1017
+ extraFileExtensions: !options.vue ? void 0 : [".vue"]
1022
1018
  }
1023
1019
  }
1024
1020
  });
@@ -1063,29 +1059,33 @@ function factory(root, options) {
1063
1059
  config.push(
1064
1060
  agilebot({
1065
1061
  root,
1066
- monorepoScope: options?.monorepoScope
1062
+ monorepoScope: options.monorepoScope
1067
1063
  })
1068
1064
  );
1069
- if (options.config) {
1070
- config.push(options.config);
1071
- }
1065
+ }
1066
+ if (options.config) {
1067
+ config.push({
1068
+ name: "agilebot/custom",
1069
+ files: DEFAULT_GLOBS,
1070
+ ...options.config
1071
+ });
1072
1072
  }
1073
1073
  config.push({
1074
1074
  name: "agilebot/ignores",
1075
1075
  ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
1076
1076
  });
1077
- const includedPlugins = /* @__PURE__ */ new Set();
1077
+ const allPlugins = {};
1078
1078
  config.forEach((configItem) => {
1079
1079
  if (configItem.plugins) {
1080
- Object.keys(configItem.plugins).forEach((pluginName) => {
1081
- if (includedPlugins.has(pluginName)) {
1082
- delete configItem.plugins[pluginName];
1083
- } else {
1084
- includedPlugins.add(pluginName);
1085
- }
1086
- });
1080
+ Object.assign(allPlugins, configItem.plugins);
1081
+ delete configItem.plugins;
1087
1082
  }
1088
1083
  });
1084
+ config.unshift({
1085
+ name: "agilebot/plugins",
1086
+ files: DEFAULT_GLOBS,
1087
+ plugins: allPlugins
1088
+ });
1089
1089
  return config;
1090
1090
  }
1091
1091
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.7.0-beta.1",
3
+ "version": "0.7.0",
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,15 +58,15 @@
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.1"
61
+ "@agilebot/eslint-utils": "0.7.0"
63
62
  },
64
63
  "devDependencies": {
65
64
  "@types/yargs": "^17.0.33",
66
65
  "eslint-config-love": "^89.0.1"
67
66
  },
68
67
  "peerDependencies": {
69
- "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
70
- "@agilebot/eslint-plugin": "0.7.0-beta.1"
68
+ "eslint": "^8.57.0 || ^9.0.0",
69
+ "@agilebot/eslint-plugin": "0.7.0"
71
70
  },
72
71
  "files": [
73
72
  "bin",