@agilebot/eslint-config 0.8.10 → 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/LICENSE +9 -9
- package/README.md +52 -52
- package/bin/eslint-agilebot +1 -1
- package/dist/cli.js +16 -22
- package/dist/{constants-ChB_LdP2.mjs → constants-D6y7pnqv.js} +0 -9
- package/dist/index.d.ts +4 -18
- package/dist/index.js +155 -182
- package/package.json +6 -7
- package/dist/cli.d.mts +0 -1
- package/dist/cli.mjs +0 -92
- package/dist/constants-U8EdftFI.js +0 -150
- package/dist/index.d.mts +0 -125
- package/dist/index.mjs +0 -1169
package/dist/index.js
CHANGED
@@ -1,60 +1,52 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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:
|
42
|
+
files: DEFAULT_GLOBS,
|
51
43
|
languageOptions: { globals: {
|
52
|
-
...globals.
|
53
|
-
...globals.
|
54
|
-
...globals.
|
55
|
-
...globals.
|
56
|
-
...globals.
|
57
|
-
...globals.
|
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:
|
422
|
+
files: DEFAULT_GLOBS,
|
431
423
|
plugins: {
|
432
|
-
n:
|
433
|
-
"@typescript-eslint":
|
434
|
-
promise:
|
435
|
-
"import-x":
|
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:
|
492
|
+
files: DEFAULT_GLOBS,
|
501
493
|
plugins: {
|
502
|
-
"@typescript-eslint":
|
503
|
-
"@stylistic":
|
504
|
-
"prefer-arrow-functions":
|
505
|
-
"unused-imports":
|
506
|
-
"react-edge":
|
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":
|
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:
|
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:
|
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:
|
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 = (
|
628
|
-
const pkgPath =
|
629
|
-
if (!
|
630
|
-
const pkg = JSON.parse(
|
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 =
|
637
|
-
const tmpPkgDir =
|
638
|
-
if (!
|
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
|
-
|
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:
|
636
|
+
files: DEFAULT_GLOBS,
|
645
637
|
plugins: {
|
646
|
-
"import-x":
|
647
|
-
"no-relative-import-paths":
|
638
|
+
"import-x": pluginImport,
|
639
|
+
"no-relative-import-paths": pluginNoRelativeImportPaths
|
648
640
|
},
|
649
641
|
rules: {
|
650
|
-
...
|
651
|
-
...
|
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":
|
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:
|
723
|
-
plugins: { unicorn:
|
714
|
+
files: DEFAULT_GLOBS,
|
715
|
+
plugins: { unicorn: pluginUnicorn },
|
724
716
|
rules: {
|
725
|
-
...
|
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:
|
751
|
+
files: DEFAULT_GLOBS,
|
760
752
|
plugins: {
|
761
|
-
react:
|
762
|
-
"react-hooks":
|
763
|
-
"jsx-a11y":
|
764
|
-
...
|
765
|
-
"@stylistic":
|
766
|
-
"@agilebot":
|
767
|
-
"react-edge":
|
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
|
-
...
|
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:
|
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:
|
858
|
-
plugins: { vue:
|
859
|
-
rules: { ...opts.version === 3 ?
|
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:
|
869
|
-
plugins: { jsdoc:
|
860
|
+
files: DEFAULT_GLOBS,
|
861
|
+
plugins: { jsdoc: pluginJsdoc },
|
870
862
|
rules: {
|
871
|
-
...opt.ts ?
|
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:
|
888
|
-
plugins: { "you-dont-need-lodash-underscore":
|
879
|
+
files: DEFAULT_GLOBS,
|
880
|
+
plugins: { "you-dont-need-lodash-underscore": fixupPluginRules(pluginLodash) },
|
889
881
|
rules: {
|
890
|
-
...
|
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:
|
902
|
-
plugins: { "@eslint-community/eslint-comments":
|
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:
|
924
|
-
plugins: { "@cspell":
|
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:
|
930
|
+
files: DEFAULT_GLOBS,
|
939
931
|
plugins: {
|
940
|
-
"@agilebot":
|
941
|
-
"react-hooks":
|
932
|
+
"@agilebot": pluginAgilebot,
|
933
|
+
"react-hooks": pluginReactHooks
|
942
934
|
},
|
943
935
|
rules: {
|
944
|
-
...
|
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.
|
962
|
-
|
963
|
-
|
964
|
-
* @license @agilebot/prettier-config v0.8.10
|
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:
|
994
|
-
plugins: { prettier:
|
969
|
+
files: DEFAULT_GLOBS,
|
970
|
+
plugins: { prettier: pluginPrettier },
|
995
971
|
rules: {
|
996
|
-
...
|
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:
|
993
|
+
files: DEFAULT_GLOBS,
|
1018
994
|
languageOptions: { parserOptions: {
|
1019
995
|
ecmaVersion: 2022,
|
1020
996
|
sourceType: "module"
|
1021
997
|
} },
|
1022
|
-
plugins: { mocha:
|
998
|
+
plugins: { mocha: pluginMocha },
|
1023
999
|
rules: {
|
1024
|
-
...
|
1025
|
-
...
|
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
|
-
|
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 =
|
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 =
|
1060
|
-
|
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)
|
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
|
1048
|
+
const config = [];
|
1076
1049
|
if (options.godaddy) {
|
1077
|
-
config
|
1050
|
+
config.push({
|
1078
1051
|
name: "agilebot/parser",
|
1079
|
-
files:
|
1052
|
+
files: DEFAULT_GLOBS,
|
1080
1053
|
languageOptions: {
|
1081
|
-
parser: options.godaddy === "typescript" ?
|
1054
|
+
parser: options.godaddy === "typescript" ? parserTs : void 0,
|
1082
1055
|
parserOptions: { project: tsconfigFiles.length > 0 ? tsconfigFiles : true }
|
1083
1056
|
}
|
1084
1057
|
});
|
1085
|
-
config
|
1086
|
-
if (options.jsdoc) config
|
1087
|
-
config
|
1088
|
-
config
|
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
|
1063
|
+
config.push({
|
1091
1064
|
name: "agilebot/parser",
|
1092
|
-
files:
|
1065
|
+
files: DEFAULT_GLOBS,
|
1093
1066
|
languageOptions: {
|
1094
|
-
parser: !options.vue ?
|
1067
|
+
parser: !options.vue ? parserTs : parserVue,
|
1095
1068
|
parserOptions: {
|
1096
|
-
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
|
1107
|
-
config
|
1108
|
-
config
|
1109
|
-
config
|
1110
|
-
config
|
1111
|
-
config
|
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
|
1114
|
-
config
|
1086
|
+
config.push(react({ version: options.react }));
|
1087
|
+
config.push(reactJsOnly());
|
1115
1088
|
}
|
1116
|
-
if (options.vue) config
|
1117
|
-
if (options.lodash) config
|
1118
|
-
if (options.cspell) config
|
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
|
1093
|
+
config.push({
|
1121
1094
|
...jsdoc({ ts: true }),
|
1122
|
-
files:
|
1095
|
+
files: TS_GLOBS
|
1123
1096
|
});
|
1124
|
-
config
|
1097
|
+
config.push({
|
1125
1098
|
...jsdoc({ ts: false }),
|
1126
|
-
files:
|
1099
|
+
files: JS_GLOBS
|
1127
1100
|
});
|
1128
1101
|
}
|
1129
|
-
config
|
1130
|
-
config
|
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
|
1109
|
+
if (options.config) config.push({
|
1137
1110
|
name: "agilebot/custom",
|
1138
|
-
files:
|
1111
|
+
files: DEFAULT_GLOBS,
|
1139
1112
|
...options.config
|
1140
1113
|
});
|
1141
|
-
config
|
1114
|
+
config.push({
|
1142
1115
|
name: "agilebot/ignores",
|
1143
|
-
ignores: [...
|
1116
|
+
ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
|
1144
1117
|
});
|
1145
1118
|
const allPlugins = {};
|
1146
|
-
config
|
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
|
1125
|
+
config.unshift({
|
1153
1126
|
name: "agilebot/plugins",
|
1154
|
-
files:
|
1127
|
+
files: DEFAULT_GLOBS,
|
1155
1128
|
plugins: allPlugins
|
1156
1129
|
});
|
1157
|
-
return config
|
1130
|
+
return config;
|
1158
1131
|
}
|
1159
1132
|
|
1160
1133
|
//#endregion
|
1161
|
-
|
1134
|
+
export { factory as agilebot };
|
package/package.json
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.
|
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.
|
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.
|
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": "^
|
70
|
-
"@agilebot/eslint-plugin": "0.
|
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 { };
|