@agilebot/eslint-config 0.8.9 → 0.9.0

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/dist/index.js CHANGED
@@ -1,60 +1,52 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.9
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
-
10
- const require_constants = require('./constants-D74t6AHL.js');
11
- const __agilebot_eslint_utils = require_constants.__toESM(require("@agilebot/eslint-utils"));
12
- const node_path = require_constants.__toESM(require("node:path"));
13
- const node_assert = require_constants.__toESM(require("node:assert"));
14
- const node_url = require_constants.__toESM(require("node:url"));
15
- const __typescript_eslint_parser = require_constants.__toESM(require("@typescript-eslint/parser"));
16
- const vue_eslint_parser = require_constants.__toESM(require("vue-eslint-parser"));
17
- const globals = require_constants.__toESM(require("globals"));
18
- const eslint_plugin_import_x = require_constants.__toESM(require("eslint-plugin-import-x"));
19
- const eslint_plugin_n = require_constants.__toESM(require("eslint-plugin-n"));
20
- const eslint_plugin_promise = require_constants.__toESM(require("eslint-plugin-promise"));
21
- const __typescript_eslint_eslint_plugin = require_constants.__toESM(require("@typescript-eslint/eslint-plugin"));
22
- const __stylistic_eslint_plugin = require_constants.__toESM(require("@stylistic/eslint-plugin"));
23
- const eslint_plugin_prefer_arrow_functions = require_constants.__toESM(require("eslint-plugin-prefer-arrow-functions"));
24
- const eslint_plugin_unused_imports = require_constants.__toESM(require("eslint-plugin-unused-imports"));
25
- const eslint_plugin_react_edge = require_constants.__toESM(require("eslint-plugin-react-edge"));
26
- const node_fs = require_constants.__toESM(require("node:fs"));
27
- const eslint_plugin_no_relative_import_paths = require_constants.__toESM(require("eslint-plugin-no-relative-import-paths"));
28
- const eslint_plugin_unicorn = require_constants.__toESM(require("eslint-plugin-unicorn"));
29
- const eslint_plugin_react = require_constants.__toESM(require("eslint-plugin-react"));
30
- const __eslint_react_eslint_plugin = require_constants.__toESM(require("@eslint-react/eslint-plugin"));
31
- const eslint_plugin_react_hooks = require_constants.__toESM(require("eslint-plugin-react-hooks"));
32
- const eslint_plugin_jsx_a11y = require_constants.__toESM(require("eslint-plugin-jsx-a11y"));
33
- const __agilebot_eslint_plugin = require_constants.__toESM(require("@agilebot/eslint-plugin"));
34
- const eslint_plugin_vue = require_constants.__toESM(require("eslint-plugin-vue"));
35
- const eslint_plugin_jsdoc = require_constants.__toESM(require("eslint-plugin-jsdoc"));
36
- const eslint_plugin_you_dont_need_lodash_underscore = require_constants.__toESM(require("eslint-plugin-you-dont-need-lodash-underscore"));
37
- const __eslint_compat = require_constants.__toESM(require("@eslint/compat"));
38
- const __eslint_community_eslint_plugin_eslint_comments = require_constants.__toESM(require("@eslint-community/eslint-plugin-eslint-comments"));
39
- const __cspell_eslint_plugin = require_constants.__toESM(require("@cspell/eslint-plugin"));
40
- const eslint_plugin_prettier_recommended = require_constants.__toESM(require("eslint-plugin-prettier/recommended"));
41
- const eslint_plugin_prettier = require_constants.__toESM(require("eslint-plugin-prettier"));
42
- const eslint_config_godaddy = require_constants.__toESM(require("eslint-config-godaddy"));
43
- const __eslint_js = require_constants.__toESM(require("@eslint/js"));
44
- const eslint_plugin_mocha = require_constants.__toESM(require("eslint-plugin-mocha"));
1
+ import { DEFAULT_GLOBS, DTS_GLOBS, IGNORE_GLOBS, JS_GLOBS, TS_GLOBS, VUE_GLOBS } from "./constants-D6y7pnqv.js";
2
+ import { findCacheDir, findRootDir, findTsconfigFiles, isInEditor } from "@agilebot/eslint-utils";
3
+ import path from "node:path";
4
+ import assert from "node:assert";
5
+ import { fileURLToPath } from "node:url";
6
+ import * as parserTs from "@typescript-eslint/parser";
7
+ import * as parserVue from "vue-eslint-parser";
8
+ import globals from "globals";
9
+ import pluginImport from "eslint-plugin-import-x";
10
+ import pluginNode from "eslint-plugin-n";
11
+ import pluginPromise from "eslint-plugin-promise";
12
+ import * as pluginTs$1 from "@typescript-eslint/eslint-plugin";
13
+ import pluginTs from "@typescript-eslint/eslint-plugin";
14
+ import pluginStylistic from "@stylistic/eslint-plugin";
15
+ import pluginPreferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
16
+ import pluginUnusedImports from "eslint-plugin-unused-imports";
17
+ import pluginReactEdge from "eslint-plugin-react-edge";
18
+ import fs from "node:fs";
19
+ import pluginNoRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
20
+ import pluginUnicorn from "eslint-plugin-unicorn";
21
+ import pluginReact from "eslint-plugin-react";
22
+ import pluginReactX from "@eslint-react/eslint-plugin";
23
+ import * as pluginReactHooks from "eslint-plugin-react-hooks";
24
+ import pluginJsxA11y from "eslint-plugin-jsx-a11y";
25
+ import pluginAgilebot from "@agilebot/eslint-plugin";
26
+ import pluginVue from "eslint-plugin-vue";
27
+ import pluginJsdoc from "eslint-plugin-jsdoc";
28
+ import pluginLodash from "eslint-plugin-you-dont-need-lodash-underscore";
29
+ import { fixupPluginRules } from "@eslint/compat";
30
+ import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
31
+ import pluginCSpell from "@cspell/eslint-plugin";
32
+ import prettierRecommended from "eslint-plugin-prettier/recommended";
33
+ import pluginPrettier from "eslint-plugin-prettier";
34
+ import configGodaddy from "eslint-config-godaddy";
35
+ import js from "@eslint/js";
36
+ import pluginMocha from "eslint-plugin-mocha";
45
37
 
46
38
  //#region src/configs/env.ts
47
39
  function env() {
48
40
  return {
49
41
  name: "agilebot/env",
50
- files: require_constants.DEFAULT_GLOBS,
42
+ files: DEFAULT_GLOBS,
51
43
  languageOptions: { globals: {
52
- ...globals.default.browser,
53
- ...globals.default.node,
54
- ...globals.default.es2015,
55
- ...globals.default.mocha,
56
- ...globals.default.jest,
57
- ...globals.default.jasmine
44
+ ...globals.browser,
45
+ ...globals.node,
46
+ ...globals.es2015,
47
+ ...globals.mocha,
48
+ ...globals.jest,
49
+ ...globals.jasmine
58
50
  } }
59
51
  };
60
52
  }
@@ -427,12 +419,12 @@ function standard() {
427
419
  });
428
420
  return {
429
421
  name: "agilebot/standard",
430
- files: require_constants.DEFAULT_GLOBS,
422
+ files: DEFAULT_GLOBS,
431
423
  plugins: {
432
- n: eslint_plugin_n.default,
433
- "@typescript-eslint": __typescript_eslint_eslint_plugin.default,
434
- promise: eslint_plugin_promise.default,
435
- "import-x": eslint_plugin_import_x.default
424
+ n: pluginNode,
425
+ "@typescript-eslint": pluginTs,
426
+ promise: pluginPromise,
427
+ "import-x": pluginImport
436
428
  },
437
429
  rules: {
438
430
  ...standardRules,
@@ -497,13 +489,13 @@ function standardDisabled() {
497
489
  function ts() {
498
490
  return {
499
491
  name: "agilebot/ts",
500
- files: require_constants.DEFAULT_GLOBS,
492
+ files: DEFAULT_GLOBS,
501
493
  plugins: {
502
- "@typescript-eslint": __typescript_eslint_eslint_plugin,
503
- "@stylistic": __stylistic_eslint_plugin.default,
504
- "prefer-arrow-functions": eslint_plugin_prefer_arrow_functions.default,
505
- "unused-imports": eslint_plugin_unused_imports.default,
506
- "react-edge": eslint_plugin_react_edge.default
494
+ "@typescript-eslint": pluginTs$1,
495
+ "@stylistic": pluginStylistic,
496
+ "prefer-arrow-functions": pluginPreferArrowFunctions,
497
+ "unused-imports": pluginUnusedImports,
498
+ "react-edge": pluginReactEdge
507
499
  },
508
500
  rules: {
509
501
  "@stylistic/quotes": [
@@ -519,7 +511,7 @@ function ts() {
519
511
  singleReturnOnly: false
520
512
  }],
521
513
  "@typescript-eslint/no-unused-vars": "off",
522
- "unused-imports/no-unused-imports": (0, __agilebot_eslint_utils.isInEditor)() ? "off" : "error",
514
+ "unused-imports/no-unused-imports": isInEditor() ? "off" : "error",
523
515
  "unused-imports/no-unused-vars": ["warn", {
524
516
  args: "after-used",
525
517
  argsIgnorePattern: "^_",
@@ -590,7 +582,7 @@ function ts() {
590
582
  function tsOnly() {
591
583
  return {
592
584
  name: "agilebot/ts-only",
593
- files: require_constants.TS_GLOBS,
585
+ files: TS_GLOBS,
594
586
  rules: {
595
587
  "prefer-object-has-own": "error",
596
588
  "@typescript-eslint/explicit-member-accessibility": "error"
@@ -600,14 +592,14 @@ function tsOnly() {
600
592
  function jsOnly() {
601
593
  return {
602
594
  name: "agilebot/js-only",
603
- files: require_constants.JS_GLOBS,
595
+ files: JS_GLOBS,
604
596
  rules: { "@typescript-eslint/no-require-imports": "off" }
605
597
  };
606
598
  }
607
599
  function dts() {
608
600
  return {
609
601
  name: "agilebot/dts",
610
- files: require_constants.DTS_GLOBS,
602
+ files: DTS_GLOBS,
611
603
  rules: {
612
604
  "@typescript-eslint/consistent-type-imports": "off",
613
605
  "@typescript-eslint/naming-convention": "off",
@@ -624,36 +616,36 @@ function dts() {
624
616
  * @param opts 参数
625
617
  */
626
618
  function imports(packageDir, opts) {
627
- const rootDir = (0, __agilebot_eslint_utils.findRootDir)(__dirname);
628
- const pkgPath = node_path.default.join(packageDir, "package.json");
629
- if (!node_fs.default.existsSync(pkgPath)) throw new Error(`package.json not found in ${packageDir}`);
630
- const pkg = JSON.parse(node_fs.default.readFileSync(pkgPath, "utf8"));
619
+ const rootDir = findRootDir(process.cwd());
620
+ const pkgPath = path.join(packageDir, "package.json");
621
+ if (!fs.existsSync(pkgPath)) throw new Error(`package.json not found in ${packageDir}`);
622
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
631
623
  const tmpPkg = {
632
624
  name: `${pkg.name}/tmp`,
633
625
  dependencies: { [pkg.name]: "*" }
634
626
  };
635
627
  const tmpPkgSafeName = tmpPkg.name.replace(/\//g, "__");
636
- const cacheDir = (0, __agilebot_eslint_utils.findCacheDir)(rootDir);
637
- const tmpPkgDir = node_path.default.join(cacheDir, "tmp-pkg", tmpPkgSafeName);
638
- if (!node_fs.default.existsSync(tmpPkgDir)) node_fs.default.mkdirSync(tmpPkgDir, { recursive: true });
628
+ const cacheDir = findCacheDir(rootDir);
629
+ const tmpPkgDir = path.join(cacheDir, "tmp-pkg", tmpPkgSafeName);
630
+ if (!fs.existsSync(tmpPkgDir)) fs.mkdirSync(tmpPkgDir, { recursive: true });
639
631
  const tmpPkgJson = JSON.stringify(tmpPkg, null, 2);
640
- node_fs.default.writeFileSync(node_path.default.join(tmpPkgDir, "package.json"), tmpPkgJson);
632
+ fs.writeFileSync(path.join(tmpPkgDir, "package.json"), tmpPkgJson);
641
633
  const ignorePatterns = [String.raw`\?(react|raw|url|inline|worker|worker&inline|worker&url|sharedworker|sharedworker&inline|sharedworker&url)$`];
642
634
  return {
643
635
  name: "agilebot/imports",
644
- files: require_constants.DEFAULT_GLOBS,
636
+ files: DEFAULT_GLOBS,
645
637
  plugins: {
646
- "import-x": eslint_plugin_import_x.default,
647
- "no-relative-import-paths": eslint_plugin_no_relative_import_paths.default
638
+ "import-x": pluginImport,
639
+ "no-relative-import-paths": pluginNoRelativeImportPaths
648
640
  },
649
641
  rules: {
650
- ...eslint_plugin_import_x.default.configs.recommended.rules,
651
- ...eslint_plugin_import_x.default.configs.typescript.rules,
642
+ ...pluginImport.configs.recommended.rules,
643
+ ...pluginImport.configs.typescript.rules,
652
644
  "import-x/no-unresolved": ["error", { ignore: ignorePatterns }],
653
645
  "import-x/no-named-as-default-member": "off",
654
646
  "import-x/no-named-as-default": "off",
655
647
  "import-x/no-useless-path-segments": ["error", { noUselessIndex: true }],
656
- "import-x/no-cycle": (0, __agilebot_eslint_utils.isInEditor)() ? "off" : "error",
648
+ "import-x/no-cycle": isInEditor() ? "off" : "error",
657
649
  "import-x/newline-after-import": "error",
658
650
  "import-x/first": "error",
659
651
  "import-x/no-import-module-exports": "error",
@@ -719,10 +711,10 @@ function imports(packageDir, opts) {
719
711
  function unicorn(opts) {
720
712
  return {
721
713
  name: "agilebot/unicorn",
722
- files: require_constants.DEFAULT_GLOBS,
723
- plugins: { unicorn: eslint_plugin_unicorn.default },
714
+ files: DEFAULT_GLOBS,
715
+ plugins: { unicorn: pluginUnicorn },
724
716
  rules: {
725
- ...eslint_plugin_unicorn.default.configs["flat/recommended"].rules,
717
+ ...pluginUnicorn.configs["flat/recommended"].rules,
726
718
  "unicorn/prefer-module": opts.module ? "error" : "off",
727
719
  "unicorn/prefer-top-level-await": "off",
728
720
  "unicorn/filename-case": "off",
@@ -756,18 +748,18 @@ function unicorn(opts) {
756
748
  function react(opts) {
757
749
  return {
758
750
  name: "agilebot/react",
759
- files: require_constants.DEFAULT_GLOBS,
751
+ files: DEFAULT_GLOBS,
760
752
  plugins: {
761
- react: eslint_plugin_react.default,
762
- "react-hooks": eslint_plugin_react_hooks,
763
- "jsx-a11y": eslint_plugin_jsx_a11y.default,
764
- ...__eslint_react_eslint_plugin.default.configs.recommended.plugins,
765
- "@stylistic": __stylistic_eslint_plugin.default,
766
- "@agilebot": __agilebot_eslint_plugin.default,
767
- "react-edge": eslint_plugin_react_edge.default
753
+ react: pluginReact,
754
+ "react-hooks": pluginReactHooks,
755
+ "jsx-a11y": pluginJsxA11y,
756
+ ...pluginReactX.configs.recommended.plugins,
757
+ "@stylistic": pluginStylistic,
758
+ "@agilebot": pluginAgilebot,
759
+ "react-edge": pluginReactEdge
768
760
  },
769
761
  rules: {
770
- ...eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules,
762
+ ...pluginJsxA11y.flatConfigs.recommended.rules,
771
763
  "@eslint-react/no-direct-mutation-state": "error",
772
764
  "@eslint-react/no-children-prop": "error",
773
765
  "@eslint-react/no-children-to-array": "warn",
@@ -837,7 +829,7 @@ function react(opts) {
837
829
  function reactJsOnly() {
838
830
  return {
839
831
  name: "agilebot/react-js-only",
840
- files: require_constants.JS_GLOBS,
832
+ files: JS_GLOBS,
841
833
  rules: {
842
834
  "react/jsx-no-duplicate-props": "error",
843
835
  "react/jsx-no-undef": "error",
@@ -854,9 +846,9 @@ function reactJsOnly() {
854
846
  function vue(opts) {
855
847
  return {
856
848
  name: "agilebot/vue",
857
- files: require_constants.VUE_GLOBS,
858
- plugins: { vue: eslint_plugin_vue.default },
859
- rules: { ...opts.version === 3 ? eslint_plugin_vue.default.configs["strongly-recommended"].rules : eslint_plugin_vue.default.configs["vue2-strongly-recommended"].rules }
849
+ files: VUE_GLOBS,
850
+ plugins: { vue: pluginVue },
851
+ rules: { ...opts.version === 3 ? pluginVue.configs["strongly-recommended"].rules : pluginVue.configs["vue2-strongly-recommended"].rules }
860
852
  };
861
853
  }
862
854
 
@@ -865,10 +857,10 @@ function vue(opts) {
865
857
  function jsdoc(opt) {
866
858
  return {
867
859
  name: "agilebot/jsdoc",
868
- files: require_constants.DEFAULT_GLOBS,
869
- plugins: { jsdoc: eslint_plugin_jsdoc.default },
860
+ files: DEFAULT_GLOBS,
861
+ plugins: { jsdoc: pluginJsdoc },
870
862
  rules: {
871
- ...opt.ts ? eslint_plugin_jsdoc.default.configs["flat/recommended-typescript-error"].rules : eslint_plugin_jsdoc.default.configs["flat/recommended-error"].rules,
863
+ ...opt.ts ? pluginJsdoc.configs["flat/recommended-typescript-error"].rules : pluginJsdoc.configs["flat/recommended-error"].rules,
872
864
  "jsdoc/no-blank-block-descriptions": "error",
873
865
  "jsdoc/no-blank-blocks": "error",
874
866
  "jsdoc/require-asterisk-prefix": "error",
@@ -884,10 +876,10 @@ function jsdoc(opt) {
884
876
  function lodash() {
885
877
  return {
886
878
  name: "agilebot/lodash",
887
- files: require_constants.DEFAULT_GLOBS,
888
- plugins: { "you-dont-need-lodash-underscore": (0, __eslint_compat.fixupPluginRules)(eslint_plugin_you_dont_need_lodash_underscore.default) },
879
+ files: DEFAULT_GLOBS,
880
+ plugins: { "you-dont-need-lodash-underscore": fixupPluginRules(pluginLodash) },
889
881
  rules: {
890
- ...eslint_plugin_you_dont_need_lodash_underscore.default.configs["all-warn"].rules,
882
+ ...pluginLodash.configs["all-warn"].rules,
891
883
  "you-dont-need-lodash-underscore/throttle": "off"
892
884
  }
893
885
  };
@@ -898,8 +890,8 @@ function lodash() {
898
890
  function comments() {
899
891
  return {
900
892
  name: "agilebot/comments",
901
- files: require_constants.DEFAULT_GLOBS,
902
- plugins: { "@eslint-community/eslint-comments": __eslint_community_eslint_plugin_eslint_comments.default },
893
+ files: DEFAULT_GLOBS,
894
+ plugins: { "@eslint-community/eslint-comments": pluginComments },
903
895
  rules: {
904
896
  "@eslint-community/eslint-comments/no-unused-disable": "error",
905
897
  "@eslint-community/eslint-comments/no-unlimited-disable": "error",
@@ -920,8 +912,8 @@ function comments() {
920
912
  function cspell(opts) {
921
913
  return {
922
914
  name: "agilebot/cspell",
923
- files: require_constants.DEFAULT_GLOBS,
924
- plugins: { "@cspell": __cspell_eslint_plugin.default },
915
+ files: DEFAULT_GLOBS,
916
+ plugins: { "@cspell": pluginCSpell },
925
917
  rules: { "@cspell/spellchecker": ["warn", {
926
918
  checkComments: false,
927
919
  autoFix: false,
@@ -935,13 +927,13 @@ function cspell(opts) {
935
927
  function agilebot(opts) {
936
928
  return {
937
929
  name: "agilebot/agilebot",
938
- files: require_constants.DEFAULT_GLOBS,
930
+ files: DEFAULT_GLOBS,
939
931
  plugins: {
940
- "@agilebot": __agilebot_eslint_plugin.default,
941
- "react-hooks": eslint_plugin_react_hooks
932
+ "@agilebot": pluginAgilebot,
933
+ "react-hooks": pluginReactHooks
942
934
  },
943
935
  rules: {
944
- ...__agilebot_eslint_plugin.default.configs.recommended.rules,
936
+ ...pluginAgilebot.configs.recommended.rules,
945
937
  "react-hooks/exhaustive-deps": "off",
946
938
  "@agilebot/react-better-exhaustive-deps": "warn"
947
939
  },
@@ -958,23 +950,8 @@ function agilebot(opts) {
958
950
  }
959
951
 
960
952
  //#endregion
961
- //#region ../prettier-config/dist/index.mjs
962
- /**
963
-
964
- * @license @agilebot/prettier-config v0.8.9
965
-
966
- *
967
-
968
- * Copyright (c) Agilebot, Inc. and its affiliates.
969
-
970
- *
971
-
972
- * This source code is licensed under the MIT license found in the
973
-
974
- * LICENSE file in the root directory of this source tree.
975
-
976
- */
977
- const config = {
953
+ //#region ../prettier-config/dist/index.js
954
+ var src_default = {
978
955
  tabWidth: 2,
979
956
  singleQuote: true,
980
957
  trailingComma: "none",
@@ -983,17 +960,16 @@ const config = {
983
960
  useTabs: false,
984
961
  arrowParens: "avoid"
985
962
  };
986
- var src_default = config;
987
963
 
988
964
  //#endregion
989
965
  //#region src/configs/prettier.ts
990
966
  function prettier(opts) {
991
967
  return {
992
968
  name: "agilebot/prettier",
993
- files: require_constants.DEFAULT_GLOBS,
994
- plugins: { prettier: eslint_plugin_prettier.default },
969
+ files: DEFAULT_GLOBS,
970
+ plugins: { prettier: pluginPrettier },
995
971
  rules: {
996
- ...eslint_plugin_prettier_recommended.default.rules,
972
+ ...prettierRecommended.rules,
997
973
  curly: "error",
998
974
  "arrow-body-style": "off",
999
975
  "prettier/prettier": [
@@ -1014,15 +990,15 @@ function prettier(opts) {
1014
990
  function godaddy() {
1015
991
  return {
1016
992
  name: "agilebot/godaddy",
1017
- files: require_constants.DEFAULT_GLOBS,
993
+ files: DEFAULT_GLOBS,
1018
994
  languageOptions: { parserOptions: {
1019
995
  ecmaVersion: 2022,
1020
996
  sourceType: "module"
1021
997
  } },
1022
- plugins: { mocha: eslint_plugin_mocha.default },
998
+ plugins: { mocha: pluginMocha },
1023
999
  rules: {
1024
- ...__eslint_js.default.configs.recommended.rules,
1025
- ...eslint_config_godaddy.default.rules,
1000
+ ...js.configs.recommended.rules,
1001
+ ...configGodaddy.rules,
1026
1002
  "quote-props": "off",
1027
1003
  "linebreak-style": "off",
1028
1004
  complexity: "off",
@@ -1051,49 +1027,46 @@ function godaddy() {
1051
1027
  //#endregion
1052
1028
  //#region src/factory/index.ts
1053
1029
  function factory(root, options) {
1054
- node_assert.default.ok(root, "root option is required");
1030
+ assert.ok(root, "root option is required");
1055
1031
  let rootDir;
1056
1032
  if (typeof root === "string") rootDir = root;
1057
- else if (root?.url) rootDir = node_path.default.dirname((0, node_url.fileURLToPath)(root.url));
1033
+ else if (root?.url) rootDir = path.dirname(fileURLToPath(root.url));
1058
1034
  else throw new Error("root must be a string or ImportMeta");
1059
- const tsconfigFiles = (0, __agilebot_eslint_utils.findTsconfigFiles)(rootDir, { absolute: true });
1060
- const defaultOptions = {
1035
+ const tsconfigFiles = findTsconfigFiles(rootDir, { absolute: true });
1036
+ options = {
1061
1037
  jsdoc: true,
1062
1038
  prettier: true,
1063
1039
  lodash: true,
1064
1040
  cspell: {},
1065
- import: true
1066
- };
1067
- options = {
1068
- ...defaultOptions,
1041
+ import: true,
1069
1042
  ...options
1070
1043
  };
1071
- if (options.config) node_assert.default.ok(Object.keys(options.config).every((key) => key === "rules" || key === "settings"), "config option must only contain rules and settings");
1044
+ if (options.config) assert.ok(Object.keys(options.config).every((key) => key === "rules" || key === "settings"), "config option must only contain rules and settings");
1072
1045
  const commonConfigs = [unicorn({ module: options.module ?? false }), comments()];
1073
1046
  if (options.import) commonConfigs.push(imports(rootDir, typeof options.import === "object" ? options.import : {}));
1074
1047
  if (options.prettier) commonConfigs.push(prettier(typeof options.prettier === "object" ? options.prettier : void 0));
1075
- const config$1 = [];
1048
+ const config = [];
1076
1049
  if (options.godaddy) {
1077
- config$1.push({
1050
+ config.push({
1078
1051
  name: "agilebot/parser",
1079
- files: require_constants.DEFAULT_GLOBS,
1052
+ files: DEFAULT_GLOBS,
1080
1053
  languageOptions: {
1081
- parser: options.godaddy === "typescript" ? __typescript_eslint_parser : void 0,
1054
+ parser: options.godaddy === "typescript" ? parserTs : void 0,
1082
1055
  parserOptions: { project: tsconfigFiles.length > 0 ? tsconfigFiles : true }
1083
1056
  }
1084
1057
  });
1085
- config$1.push(env());
1086
- if (options.jsdoc) config$1.push(jsdoc({ ts: false }));
1087
- config$1.push(...commonConfigs);
1088
- config$1.push(godaddy());
1058
+ config.push(env());
1059
+ if (options.jsdoc) config.push(jsdoc({ ts: false }));
1060
+ config.push(...commonConfigs);
1061
+ config.push(godaddy());
1089
1062
  } else {
1090
- config$1.push({
1063
+ config.push({
1091
1064
  name: "agilebot/parser",
1092
- files: require_constants.DEFAULT_GLOBS,
1065
+ files: DEFAULT_GLOBS,
1093
1066
  languageOptions: {
1094
- parser: !options.vue ? __typescript_eslint_parser : vue_eslint_parser,
1067
+ parser: !options.vue ? parserTs : parserVue,
1095
1068
  parserOptions: {
1096
- parser: __typescript_eslint_parser,
1069
+ parser: parserTs,
1097
1070
  tsconfigRootDir: root,
1098
1071
  projectService: true,
1099
1072
  project: tsconfigFiles.length > 0 ? tsconfigFiles : true,
@@ -1103,59 +1076,59 @@ function factory(root, options) {
1103
1076
  }
1104
1077
  }
1105
1078
  });
1106
- config$1.push(env());
1107
- config$1.push(standard());
1108
- config$1.push(ts());
1109
- config$1.push(jsOnly());
1110
- config$1.push(dts());
1111
- config$1.push(tsOnly());
1079
+ config.push(env());
1080
+ config.push(standard());
1081
+ config.push(ts());
1082
+ config.push(jsOnly());
1083
+ config.push(dts());
1084
+ config.push(tsOnly());
1112
1085
  if (options.react) {
1113
- config$1.push(react({ version: options.react }));
1114
- config$1.push(reactJsOnly());
1086
+ config.push(react({ version: options.react }));
1087
+ config.push(reactJsOnly());
1115
1088
  }
1116
- if (options.vue) config$1.push(vue({ version: options.vue }));
1117
- if (options.lodash) config$1.push(lodash());
1118
- if (options.cspell) config$1.push(cspell(options.cspell));
1089
+ if (options.vue) config.push(vue({ version: options.vue }));
1090
+ if (options.lodash) config.push(lodash());
1091
+ if (options.cspell) config.push(cspell(options.cspell));
1119
1092
  if (options.jsdoc) {
1120
- config$1.push({
1093
+ config.push({
1121
1094
  ...jsdoc({ ts: true }),
1122
- files: require_constants.TS_GLOBS
1095
+ files: TS_GLOBS
1123
1096
  });
1124
- config$1.push({
1097
+ config.push({
1125
1098
  ...jsdoc({ ts: false }),
1126
- files: require_constants.JS_GLOBS
1099
+ files: JS_GLOBS
1127
1100
  });
1128
1101
  }
1129
- config$1.push(...commonConfigs);
1130
- config$1.push(agilebot({
1102
+ config.push(...commonConfigs);
1103
+ config.push(agilebot({
1131
1104
  root: rootDir,
1132
1105
  monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0,
1133
1106
  tss: options.tss
1134
1107
  }));
1135
1108
  }
1136
- if (options.config) config$1.push({
1109
+ if (options.config) config.push({
1137
1110
  name: "agilebot/custom",
1138
- files: require_constants.DEFAULT_GLOBS,
1111
+ files: DEFAULT_GLOBS,
1139
1112
  ...options.config
1140
1113
  });
1141
- config$1.push({
1114
+ config.push({
1142
1115
  name: "agilebot/ignores",
1143
- ignores: [...require_constants.IGNORE_GLOBS, ...options.ignores ?? []]
1116
+ ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
1144
1117
  });
1145
1118
  const allPlugins = {};
1146
- config$1.forEach((configItem) => {
1119
+ config.forEach((configItem) => {
1147
1120
  if (configItem.plugins) {
1148
1121
  Object.assign(allPlugins, configItem.plugins);
1149
1122
  delete configItem.plugins;
1150
1123
  }
1151
1124
  });
1152
- config$1.unshift({
1125
+ config.unshift({
1153
1126
  name: "agilebot/plugins",
1154
- files: require_constants.DEFAULT_GLOBS,
1127
+ files: DEFAULT_GLOBS,
1155
1128
  plugins: allPlugins
1156
1129
  });
1157
- return config$1;
1130
+ return config;
1158
1131
  }
1159
1132
 
1160
1133
  //#endregion
1161
- exports.agilebot = factory;
1134
+ export { factory as agilebot };
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.8.9",
3
+ "version": "0.9.0",
4
+ "type": "module",
4
5
  "description": "Agilebot's ESLint config",
5
6
  "bin": {
6
7
  "eslint-agilebot": "bin/eslint-agilebot"
7
8
  },
8
9
  "main": "./dist/index.js",
9
- "module": "./dist/index.mjs",
10
10
  "types": "./dist/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
- "import": "./dist/index.mjs",
15
- "require": "./dist/index.js"
14
+ "import": "./dist/index.js"
16
15
  }
17
16
  },
18
17
  "license": "MIT",
@@ -59,15 +58,15 @@
59
58
  "globals": "^16.2.0",
60
59
  "vue-eslint-parser": "^10.1.3",
61
60
  "yargs": "^17.7.2",
62
- "@agilebot/eslint-utils": "0.8.9"
61
+ "@agilebot/eslint-utils": "0.9.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": "^8.57.0 || ^9.0.0",
70
- "@agilebot/eslint-plugin": "0.8.9"
68
+ "eslint": "^9.0.0",
69
+ "@agilebot/eslint-plugin": "0.9.0"
71
70
  },
72
71
  "files": [
73
72
  "bin",
package/dist/cli.d.mts DELETED
@@ -1 +0,0 @@
1
- export { };