@agilebot/eslint-config 0.8.0 → 0.8.2
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/bin/eslint-agilebot +2 -2
- package/dist/cli.d.mts +1 -2
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +76 -134
- package/dist/cli.mjs +77 -98
- package/dist/constants-uP0zspUv.js +150 -0
- package/dist/constants-zSSLGYP3.mjs +79 -0
- package/dist/index.d.mts +117 -98
- package/dist/index.d.ts +117 -98
- package/dist/index.js +1089 -1142
- package/dist/index.mjs +1091 -1059
- package/package.json +6 -4
- package/dist/chunk-NVFPC5RO.mjs +0 -84
package/dist/index.js
CHANGED
@@ -1,1201 +1,1148 @@
|
|
1
|
-
/**
|
2
|
-
* @license @agilebot/eslint-config v0.8.
|
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
|
-
"use strict";
|
11
|
-
var __create = Object.create;
|
12
|
-
var __defProp = Object.defineProperty;
|
13
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
14
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
15
|
-
var __getProtoOf = Object.getPrototypeOf;
|
16
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
17
|
-
var __export = (target, all) => {
|
18
|
-
for (var name in all)
|
19
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
20
|
-
};
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
23
|
-
for (let key of __getOwnPropNames(from))
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
26
|
-
}
|
27
|
-
return to;
|
28
|
-
};
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
35
|
-
mod
|
36
|
-
));
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
38
|
-
|
39
|
-
// src/index.ts
|
40
|
-
var index_exports = {};
|
41
|
-
__export(index_exports, {
|
42
|
-
agilebot: () => factory
|
43
|
-
});
|
44
|
-
module.exports = __toCommonJS(index_exports);
|
45
|
-
|
46
|
-
// <define:__STANDARD_RULES>
|
47
|
-
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 }] };
|
1
|
+
/**
|
2
|
+
* @license @agilebot/eslint-config v0.8.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
|
+
*/
|
48
9
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
10
|
+
const require_constants = require('./constants-uP0zspUv.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"));
|
56
45
|
|
57
|
-
|
58
|
-
var import_globals = __toESM(require("globals"));
|
59
|
-
|
60
|
-
// src/constants.ts
|
61
|
-
var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
|
62
|
-
var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
|
63
|
-
var DTS_EXTS = [".d.ts", ".d.cts", ".d.mts"];
|
64
|
-
var VUE_EXTS = [".vue"];
|
65
|
-
var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
|
66
|
-
var JS_GLOBS = JS_EXTS.map((ext) => `**/*${ext}`);
|
67
|
-
var TS_GLOBS = TS_EXTS.map((ext) => `**/*${ext}`);
|
68
|
-
var DTS_GLOBS = DTS_EXTS.map((ext) => `**/*${ext}`);
|
69
|
-
var VUE_GLOBS = VUE_EXTS.map((ext) => `**/*${ext}`);
|
70
|
-
var DEFAULT_GLOBS = DEFAULT_EXTS.map((ext) => `**/*${ext}`);
|
71
|
-
var IGNORE_GLOBS = [
|
72
|
-
"**/node_modules",
|
73
|
-
"**/dist",
|
74
|
-
"**/package-lock.json",
|
75
|
-
"**/yarn.lock",
|
76
|
-
"**/pnpm-lock.yaml",
|
77
|
-
"**/bun.lockb",
|
78
|
-
"**/output",
|
79
|
-
"**/coverage",
|
80
|
-
"**/temp",
|
81
|
-
"**/.temp",
|
82
|
-
"**/tmp",
|
83
|
-
"**/.tmp",
|
84
|
-
"**/.history",
|
85
|
-
"**/.vitepress/cache",
|
86
|
-
"**/.nuxt",
|
87
|
-
"**/.next",
|
88
|
-
"**/.svelte-kit",
|
89
|
-
"**/.vercel",
|
90
|
-
"**/.changeset",
|
91
|
-
"**/.idea",
|
92
|
-
"**/.cache",
|
93
|
-
"**/.output",
|
94
|
-
"**/.vite-inspect",
|
95
|
-
"**/.yarn",
|
96
|
-
"**/vite.config.*.timestamp-*",
|
97
|
-
"**/CHANGELOG*.md",
|
98
|
-
"**/*.min.*",
|
99
|
-
"**/LICENSE*",
|
100
|
-
"**/__snapshots__",
|
101
|
-
"**/auto-import?(s).d.ts",
|
102
|
-
"**/components.d.ts"
|
103
|
-
];
|
104
|
-
|
105
|
-
// src/configs/env.ts
|
46
|
+
//#region src/configs/env.ts
|
106
47
|
function env() {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
}
|
120
|
-
};
|
48
|
+
return {
|
49
|
+
name: "agilebot/env",
|
50
|
+
files: require_constants.DEFAULT_GLOBS,
|
51
|
+
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
|
58
|
+
} }
|
59
|
+
};
|
121
60
|
}
|
122
61
|
|
123
|
-
|
124
|
-
|
125
|
-
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"));
|
126
|
-
var import_eslint_plugin_promise = __toESM(require("eslint-plugin-promise"));
|
127
|
-
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"));
|
62
|
+
//#endregion
|
63
|
+
//#region src/configs/standard.ts
|
128
64
|
function standard() {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
65
|
+
const standardRules = {};
|
66
|
+
const originalStdRules = {
|
67
|
+
"class-methods-use-this": ["off"],
|
68
|
+
"dot-notation": ["off"],
|
69
|
+
"init-declarations": ["off"],
|
70
|
+
"max-params": ["off"],
|
71
|
+
"no-array-constructor": ["off"],
|
72
|
+
"no-dupe-class-members": ["off"],
|
73
|
+
"no-empty-function": ["off"],
|
74
|
+
"no-implied-eval": ["off"],
|
75
|
+
"no-loop-func": ["off"],
|
76
|
+
"no-magic-numbers": ["off"],
|
77
|
+
"no-unused-expressions": ["off"],
|
78
|
+
"no-unused-vars": ["off"],
|
79
|
+
"no-use-before-define": ["off"],
|
80
|
+
"no-useless-constructor": ["off"],
|
81
|
+
"prefer-destructuring": ["off"],
|
82
|
+
"prefer-promise-reject-errors": ["off"],
|
83
|
+
"accessor-pairs": ["error", {
|
84
|
+
"setWithoutGet": true,
|
85
|
+
"getWithoutSet": false,
|
86
|
+
"enforceForClassMembers": true
|
87
|
+
}],
|
88
|
+
"array-callback-return": ["error", {
|
89
|
+
"allowImplicit": false,
|
90
|
+
"allowVoid": false,
|
91
|
+
"checkForEach": false
|
92
|
+
}],
|
93
|
+
"constructor-super": ["error"],
|
94
|
+
"curly": ["error", "multi-line"],
|
95
|
+
"default-case-last": ["error"],
|
96
|
+
"eqeqeq": [
|
97
|
+
"error",
|
98
|
+
"always",
|
99
|
+
{ "null": "ignore" }
|
100
|
+
],
|
101
|
+
"new-cap": ["error", {
|
102
|
+
"newIsCap": true,
|
103
|
+
"capIsNew": false,
|
104
|
+
"properties": true
|
105
|
+
}],
|
106
|
+
"no-async-promise-executor": ["error"],
|
107
|
+
"no-caller": ["error"],
|
108
|
+
"no-case-declarations": ["error"],
|
109
|
+
"no-class-assign": ["error"],
|
110
|
+
"no-compare-neg-zero": ["error"],
|
111
|
+
"no-cond-assign": ["error"],
|
112
|
+
"no-const-assign": ["error"],
|
113
|
+
"no-constant-condition": ["error", { "checkLoops": false }],
|
114
|
+
"no-control-regex": ["error"],
|
115
|
+
"no-debugger": ["error"],
|
116
|
+
"no-delete-var": ["error"],
|
117
|
+
"no-dupe-args": ["error"],
|
118
|
+
"no-dupe-keys": ["error"],
|
119
|
+
"no-duplicate-case": ["error"],
|
120
|
+
"no-useless-backreference": ["error"],
|
121
|
+
"no-empty": ["error", { "allowEmptyCatch": true }],
|
122
|
+
"no-empty-character-class": ["error"],
|
123
|
+
"no-empty-pattern": ["error"],
|
124
|
+
"no-eval": ["error"],
|
125
|
+
"no-ex-assign": ["error"],
|
126
|
+
"no-extend-native": ["error"],
|
127
|
+
"no-extra-bind": ["error"],
|
128
|
+
"no-extra-boolean-cast": ["error"],
|
129
|
+
"no-fallthrough": ["error"],
|
130
|
+
"no-func-assign": ["error"],
|
131
|
+
"no-global-assign": ["error"],
|
132
|
+
"no-import-assign": ["error"],
|
133
|
+
"no-invalid-regexp": ["error"],
|
134
|
+
"no-irregular-whitespace": ["error"],
|
135
|
+
"no-iterator": ["error"],
|
136
|
+
"no-labels": ["error", {
|
137
|
+
"allowLoop": false,
|
138
|
+
"allowSwitch": false
|
139
|
+
}],
|
140
|
+
"no-lone-blocks": ["error"],
|
141
|
+
"no-loss-of-precision": ["error"],
|
142
|
+
"no-misleading-character-class": ["error"],
|
143
|
+
"no-prototype-builtins": ["error"],
|
144
|
+
"no-useless-catch": ["error"],
|
145
|
+
"no-multi-str": ["error"],
|
146
|
+
"no-new": ["error"],
|
147
|
+
"no-new-func": ["error"],
|
148
|
+
"no-new-native-nonconstructor": ["error"],
|
149
|
+
"no-new-wrappers": ["error"],
|
150
|
+
"no-obj-calls": ["error"],
|
151
|
+
"no-object-constructor": ["error"],
|
152
|
+
"no-octal": ["error"],
|
153
|
+
"no-octal-escape": ["error"],
|
154
|
+
"no-proto": ["error"],
|
155
|
+
"no-regex-spaces": ["error"],
|
156
|
+
"no-return-assign": ["error", "except-parens"],
|
157
|
+
"no-self-assign": ["error", { "props": true }],
|
158
|
+
"no-self-compare": ["error"],
|
159
|
+
"no-sequences": ["error"],
|
160
|
+
"no-shadow-restricted-names": ["error"],
|
161
|
+
"no-sparse-arrays": ["error"],
|
162
|
+
"no-template-curly-in-string": ["error"],
|
163
|
+
"no-this-before-super": ["error"],
|
164
|
+
"no-throw-literal": ["off"],
|
165
|
+
"no-unexpected-multiline": ["error"],
|
166
|
+
"no-unmodified-loop-condition": ["error"],
|
167
|
+
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
|
168
|
+
"no-unreachable": ["error"],
|
169
|
+
"no-unreachable-loop": ["error"],
|
170
|
+
"no-unsafe-finally": ["error"],
|
171
|
+
"no-unsafe-negation": ["error"],
|
172
|
+
"no-useless-call": ["error"],
|
173
|
+
"no-useless-computed-key": ["error"],
|
174
|
+
"no-useless-escape": ["error"],
|
175
|
+
"no-useless-rename": ["error"],
|
176
|
+
"no-useless-return": ["error"],
|
177
|
+
"no-var": ["error"],
|
178
|
+
"no-void": ["error", { "allowAsStatement": true }],
|
179
|
+
"no-with": ["error"],
|
180
|
+
"object-shorthand": ["warn", "properties"],
|
181
|
+
"one-var": ["error", { "initialized": "never" }],
|
182
|
+
"prefer-const": ["error", {
|
183
|
+
"destructuring": "all",
|
184
|
+
"ignoreReadBeforeAssign": false
|
185
|
+
}],
|
186
|
+
"prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }],
|
187
|
+
"symbol-description": ["error"],
|
188
|
+
"unicode-bom": ["error", "never"],
|
189
|
+
"use-isnan": ["error", {
|
190
|
+
"enforceForSwitchCase": true,
|
191
|
+
"enforceForIndexOf": true
|
192
|
+
}],
|
193
|
+
"valid-typeof": ["error", { "requireStringLiterals": true }],
|
194
|
+
"yoda": ["error", "never"],
|
195
|
+
"import/export": ["error"],
|
196
|
+
"import/first": ["error"],
|
197
|
+
"import/no-absolute-path": ["error", {
|
198
|
+
"esmodule": true,
|
199
|
+
"commonjs": true,
|
200
|
+
"amd": false
|
201
|
+
}],
|
202
|
+
"import/no-duplicates": ["error"],
|
203
|
+
"import/no-named-default": ["error"],
|
204
|
+
"import/no-webpack-loader-syntax": ["error"],
|
205
|
+
"n/handle-callback-err": ["error", "^(err|error)$"],
|
206
|
+
"n/no-callback-literal": ["error"],
|
207
|
+
"n/no-deprecated-api": ["error"],
|
208
|
+
"n/no-exports-assign": ["error"],
|
209
|
+
"n/no-new-require": ["error"],
|
210
|
+
"n/no-path-concat": ["error"],
|
211
|
+
"n/process-exit-as-throw": ["error"],
|
212
|
+
"promise/param-names": ["error"],
|
213
|
+
"@typescript-eslint/adjacent-overload-signatures": ["error"],
|
214
|
+
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
|
215
|
+
"@typescript-eslint/await-thenable": ["error"],
|
216
|
+
"@typescript-eslint/ban-ts-comment": ["error", {
|
217
|
+
"ts-expect-error": "allow-with-description",
|
218
|
+
"ts-ignore": true,
|
219
|
+
"ts-nocheck": true,
|
220
|
+
"ts-check": false,
|
221
|
+
"minimumDescriptionLength": 3
|
222
|
+
}],
|
223
|
+
"@typescript-eslint/ban-tslint-comment": ["error"],
|
224
|
+
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
225
|
+
"@typescript-eslint/class-methods-use-this": ["error", {
|
226
|
+
"exceptMethods": [],
|
227
|
+
"enforceForClassFields": true,
|
228
|
+
"ignoreOverrideMethods": false,
|
229
|
+
"ignoreClassesThatImplementAnInterface": false
|
230
|
+
}],
|
231
|
+
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
232
|
+
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
233
|
+
"@typescript-eslint/consistent-type-assertions": ["error", {
|
234
|
+
"assertionStyle": "as",
|
235
|
+
"objectLiteralTypeAssertions": "never"
|
236
|
+
}],
|
237
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
238
|
+
"@typescript-eslint/consistent-type-exports": ["error", { "fixMixedExportsWithInlineTypeSpecifier": true }],
|
239
|
+
"@typescript-eslint/consistent-type-imports": ["error", {
|
240
|
+
"prefer": "type-imports",
|
241
|
+
"disallowTypeAnnotations": true,
|
242
|
+
"fixStyle": "inline-type-imports"
|
243
|
+
}],
|
244
|
+
"@typescript-eslint/dot-notation": ["error", {
|
245
|
+
"allowIndexSignaturePropertyAccess": false,
|
246
|
+
"allowKeywords": true,
|
247
|
+
"allowPattern": "",
|
248
|
+
"allowPrivateClassPropertyAccess": false,
|
249
|
+
"allowProtectedClassPropertyAccess": false
|
250
|
+
}],
|
251
|
+
"@typescript-eslint/explicit-function-return-type": ["error", {
|
252
|
+
"allowExpressions": true,
|
253
|
+
"allowHigherOrderFunctions": true,
|
254
|
+
"allowTypedFunctionExpressions": true,
|
255
|
+
"allowDirectConstAssertionInArrowFunctions": true
|
256
|
+
}],
|
257
|
+
"@typescript-eslint/init-declarations": ["error", "always"],
|
258
|
+
"@typescript-eslint/max-params": ["error", { "max": 4 }],
|
259
|
+
"@typescript-eslint/method-signature-style": ["error"],
|
260
|
+
"@typescript-eslint/naming-convention": ["error", {
|
261
|
+
"selector": "variableLike",
|
262
|
+
"leadingUnderscore": "allow",
|
263
|
+
"trailingUnderscore": "allow",
|
264
|
+
"format": [
|
265
|
+
"camelCase",
|
266
|
+
"PascalCase",
|
267
|
+
"UPPER_CASE"
|
268
|
+
]
|
269
|
+
}],
|
270
|
+
"@typescript-eslint/no-array-constructor": ["error"],
|
271
|
+
"@typescript-eslint/no-array-delete": ["error"],
|
272
|
+
"@typescript-eslint/no-base-to-string": ["error"],
|
273
|
+
"@typescript-eslint/no-confusing-non-null-assertion": ["error"],
|
274
|
+
"@typescript-eslint/no-confusing-void-expression": ["error", {
|
275
|
+
"ignoreArrowShorthand": false,
|
276
|
+
"ignoreVoidOperator": false
|
277
|
+
}],
|
278
|
+
"@typescript-eslint/no-deprecated": ["warn"],
|
279
|
+
"@typescript-eslint/no-dupe-class-members": ["error"],
|
280
|
+
"@typescript-eslint/no-duplicate-enum-values": ["error"],
|
281
|
+
"@typescript-eslint/no-duplicate-type-constituents": ["error", {
|
282
|
+
"ignoreIntersections": false,
|
283
|
+
"ignoreUnions": false
|
284
|
+
}],
|
285
|
+
"@typescript-eslint/no-dynamic-delete": ["error"],
|
286
|
+
"@typescript-eslint/no-empty-function": ["error", { "allow": [] }],
|
287
|
+
"@typescript-eslint/no-empty-object-type": ["error", {
|
288
|
+
"allowInterfaces": "with-single-extends",
|
289
|
+
"allowObjectTypes": "never"
|
290
|
+
}],
|
291
|
+
"@typescript-eslint/no-explicit-any": ["error", {
|
292
|
+
"fixToUnknown": false,
|
293
|
+
"ignoreRestArgs": false
|
294
|
+
}],
|
295
|
+
"@typescript-eslint/no-extra-non-null-assertion": ["error"],
|
296
|
+
"@typescript-eslint/no-extraneous-class": ["error", { "allowWithDecorator": true }],
|
297
|
+
"@typescript-eslint/no-floating-promises": ["error"],
|
298
|
+
"@typescript-eslint/no-for-in-array": ["error"],
|
299
|
+
"@typescript-eslint/no-implied-eval": ["error"],
|
300
|
+
"@typescript-eslint/no-import-type-side-effects": ["error"],
|
301
|
+
"@typescript-eslint/no-inferrable-types": ["error", {
|
302
|
+
"ignoreParameters": false,
|
303
|
+
"ignoreProperties": false
|
304
|
+
}],
|
305
|
+
"@typescript-eslint/no-invalid-void-type": ["error"],
|
306
|
+
"@typescript-eslint/no-loop-func": ["error"],
|
307
|
+
"@typescript-eslint/no-magic-numbers": ["error", {
|
308
|
+
"ignore": [],
|
309
|
+
"ignoreArrayIndexes": false,
|
310
|
+
"ignoreDefaultValues": false,
|
311
|
+
"ignoreClassFieldInitialValues": false,
|
312
|
+
"enforceConst": false,
|
313
|
+
"detectObjects": true,
|
314
|
+
"ignoreEnums": true,
|
315
|
+
"ignoreNumericLiteralTypes": false,
|
316
|
+
"ignoreReadonlyClassProperties": true,
|
317
|
+
"ignoreTypeIndexes": false
|
318
|
+
}],
|
319
|
+
"@typescript-eslint/no-meaningless-void-operator": ["error", { "checkNever": true }],
|
320
|
+
"@typescript-eslint/no-misused-new": ["error"],
|
321
|
+
"@typescript-eslint/no-misused-promises": ["error"],
|
322
|
+
"@typescript-eslint/no-mixed-enums": ["error"],
|
323
|
+
"@typescript-eslint/no-namespace": ["error"],
|
324
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": ["error"],
|
325
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": ["error"],
|
326
|
+
"@typescript-eslint/no-non-null-assertion": ["error"],
|
327
|
+
"@typescript-eslint/no-redundant-type-constituents": ["error"],
|
328
|
+
"@typescript-eslint/no-require-imports": ["error", {
|
329
|
+
"allow": [],
|
330
|
+
"allowAsImport": false
|
331
|
+
}],
|
332
|
+
"@typescript-eslint/no-this-alias": ["error", { "allowDestructuring": true }],
|
333
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error"],
|
334
|
+
"@typescript-eslint/no-unnecessary-condition": ["error", { "allowConstantLoopConditions": true }],
|
335
|
+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": ["error"],
|
336
|
+
"@typescript-eslint/no-unnecessary-qualifier": ["error"],
|
337
|
+
"@typescript-eslint/no-unnecessary-template-expression": ["error"],
|
338
|
+
"@typescript-eslint/no-unnecessary-type-arguments": ["error"],
|
339
|
+
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
|
340
|
+
"@typescript-eslint/no-unnecessary-type-constraint": ["error"],
|
341
|
+
"@typescript-eslint/no-unnecessary-type-parameters": ["error"],
|
342
|
+
"@typescript-eslint/no-unsafe-argument": ["error"],
|
343
|
+
"@typescript-eslint/no-unsafe-assignment": ["error"],
|
344
|
+
"@typescript-eslint/no-unsafe-call": ["error"],
|
345
|
+
"@typescript-eslint/no-unsafe-declaration-merging": ["error"],
|
346
|
+
"@typescript-eslint/no-unsafe-enum-comparison": ["error"],
|
347
|
+
"@typescript-eslint/no-unsafe-function-type": ["error"],
|
348
|
+
"@typescript-eslint/no-unsafe-member-access": ["error"],
|
349
|
+
"@typescript-eslint/no-unsafe-return": ["error"],
|
350
|
+
"@typescript-eslint/no-unsafe-unary-minus": ["error"],
|
351
|
+
"@typescript-eslint/no-unused-expressions": ["error", {
|
352
|
+
"allowShortCircuit": true,
|
353
|
+
"allowTernary": true,
|
354
|
+
"allowTaggedTemplates": true,
|
355
|
+
"enforceForJSX": false
|
356
|
+
}],
|
357
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
358
|
+
"args": "none",
|
359
|
+
"caughtErrors": "none",
|
360
|
+
"ignoreRestSiblings": true,
|
361
|
+
"vars": "all"
|
362
|
+
}],
|
363
|
+
"@typescript-eslint/no-use-before-define": ["error", {
|
364
|
+
"functions": false,
|
365
|
+
"classes": false,
|
366
|
+
"enums": false,
|
367
|
+
"variables": false,
|
368
|
+
"typedefs": false
|
369
|
+
}],
|
370
|
+
"@typescript-eslint/no-useless-constructor": ["error"],
|
371
|
+
"@typescript-eslint/no-useless-empty-export": ["error"],
|
372
|
+
"@typescript-eslint/no-wrapper-object-types": ["error"],
|
373
|
+
"@typescript-eslint/non-nullable-type-assertion-style": ["error"],
|
374
|
+
"@typescript-eslint/only-throw-error": ["error", {
|
375
|
+
"allowThrowingAny": false,
|
376
|
+
"allowThrowingUnknown": false
|
377
|
+
}],
|
378
|
+
"@typescript-eslint/prefer-as-const": ["error"],
|
379
|
+
"@typescript-eslint/prefer-destructuring": [
|
380
|
+
"error",
|
381
|
+
{
|
382
|
+
"array": true,
|
383
|
+
"object": true
|
384
|
+
},
|
385
|
+
{
|
386
|
+
"enforceForRenamedProperties": true,
|
387
|
+
"enforceForDeclarationWithTypeAnnotation": false
|
388
|
+
}
|
389
|
+
],
|
390
|
+
"@typescript-eslint/prefer-function-type": ["error"],
|
391
|
+
"@typescript-eslint/prefer-includes": ["error"],
|
392
|
+
"@typescript-eslint/prefer-nullish-coalescing": ["error", {
|
393
|
+
"ignoreConditionalTests": false,
|
394
|
+
"ignoreMixedLogicalExpressions": false
|
395
|
+
}],
|
396
|
+
"@typescript-eslint/prefer-optional-chain": ["error"],
|
397
|
+
"@typescript-eslint/prefer-promise-reject-errors": ["error"],
|
398
|
+
"@typescript-eslint/prefer-readonly": ["error"],
|
399
|
+
"@typescript-eslint/prefer-reduce-type-parameter": ["error"],
|
400
|
+
"@typescript-eslint/prefer-return-this-type": ["error"],
|
401
|
+
"@typescript-eslint/promise-function-async": ["error"],
|
402
|
+
"@typescript-eslint/require-array-sort-compare": ["error", { "ignoreStringArrays": true }],
|
403
|
+
"@typescript-eslint/restrict-plus-operands": ["error", { "skipCompoundAssignments": false }],
|
404
|
+
"@typescript-eslint/restrict-template-expressions": ["error", { "allowNumber": true }],
|
405
|
+
"@typescript-eslint/return-await": ["error", "always"],
|
406
|
+
"@typescript-eslint/strict-boolean-expressions": ["error", {
|
407
|
+
"allowString": false,
|
408
|
+
"allowNumber": false,
|
409
|
+
"allowNullableObject": false,
|
410
|
+
"allowNullableBoolean": false,
|
411
|
+
"allowNullableString": false,
|
412
|
+
"allowNullableNumber": false,
|
413
|
+
"allowAny": false
|
414
|
+
}],
|
415
|
+
"@typescript-eslint/triple-slash-reference": ["error", {
|
416
|
+
"lib": "never",
|
417
|
+
"path": "never",
|
418
|
+
"types": "never"
|
419
|
+
}],
|
420
|
+
"@typescript-eslint/unbound-method": ["error", { "ignoreStatic": false }]
|
421
|
+
};
|
422
|
+
const disabledRules = new Set(Object.values(standardDisabled()).flat());
|
423
|
+
Object.entries(originalStdRules).forEach(([key, value]) => {
|
424
|
+
if (disabledRules.has(key)) return;
|
425
|
+
if (key.startsWith("import/")) standardRules[`import-x/${key.slice(7)}`] = value;
|
426
|
+
else standardRules[key] = value;
|
427
|
+
});
|
428
|
+
return {
|
429
|
+
name: "agilebot/standard",
|
430
|
+
files: require_constants.DEFAULT_GLOBS,
|
431
|
+
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
|
436
|
+
},
|
437
|
+
rules: {
|
438
|
+
...standardRules,
|
439
|
+
"no-alert": "error",
|
440
|
+
"no-warning-comments": ["warn", { terms: ["todo", "fixme"] }],
|
441
|
+
"n/no-sync": "error",
|
442
|
+
"n/prefer-promises/fs": "error",
|
443
|
+
"n/prefer-promises/dns": "error",
|
444
|
+
"n/no-path-concat": "error",
|
445
|
+
"promise/no-return-wrap": "error",
|
446
|
+
"promise/no-nesting": "error",
|
447
|
+
"promise/no-promise-in-callback": "error",
|
448
|
+
"promise/no-callback-in-promise": "error",
|
449
|
+
"promise/param-names": "error",
|
450
|
+
"promise/valid-params": "error",
|
451
|
+
"promise/no-multiple-resolved": "error",
|
452
|
+
"promise/no-return-in-finally": "error",
|
453
|
+
"promise/prefer-await-to-then": "warn",
|
454
|
+
"@typescript-eslint/max-params": ["error", { max: 5 }],
|
455
|
+
"@typescript-eslint/only-throw-error": ["error", {
|
456
|
+
allowThrowingAny: true,
|
457
|
+
allowThrowingUnknown: true
|
458
|
+
}],
|
459
|
+
"@typescript-eslint/no-loop-func": "warn"
|
460
|
+
}
|
461
|
+
};
|
195
462
|
}
|
196
463
|
function standardDisabled() {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
"v75.0.0": ["@typescript-eslint/no-unnecessary-type-parameters"],
|
226
|
-
"v76.0.0": ["@typescript-eslint/no-unsafe-assignment"],
|
227
|
-
"v77.0.0": ["@typescript-eslint/no-unsafe-call"],
|
228
|
-
"v79.0.0": ["@typescript-eslint/no-unsafe-enum-comparison"],
|
229
|
-
"v80.0.0": ["@typescript-eslint/no-unsafe-member-access"],
|
230
|
-
"v81.0.0": ["@typescript-eslint/no-unsafe-return"],
|
231
|
-
"v82.0.0": ["@typescript-eslint/no-unsafe-unary-minus"],
|
232
|
-
"v89.0.0": ["@typescript-eslint/prefer-destructuring"]
|
233
|
-
};
|
464
|
+
return {
|
465
|
+
uncategoized: [
|
466
|
+
"@typescript-eslint/no-extraneous-class",
|
467
|
+
"@typescript-eslint/consistent-type-assertions",
|
468
|
+
"@typescript-eslint/no-non-null-assertion"
|
469
|
+
],
|
470
|
+
"v9.0.0": ["@typescript-eslint/strict-boolean-expressions"],
|
471
|
+
"v10.0.0": ["@typescript-eslint/explicit-function-return-type"],
|
472
|
+
"v12.0.0": ["@typescript-eslint/restrict-template-expressions", "@typescript-eslint/space-before-function-paren"],
|
473
|
+
"v17.0.0": ["@typescript-eslint/no-invalid-void-type", "@typescript-eslint/method-signature-style"],
|
474
|
+
"v26.0.0": ["@typescript-eslint/no-confusing-void-expression"],
|
475
|
+
"v40.0.0": ["@typescript-eslint/unbound-method"],
|
476
|
+
"v42.0.0": ["@typescript-eslint/no-unsafe-argument"],
|
477
|
+
"v55.0.0": ["@typescript-eslint/class-methods-use-this"],
|
478
|
+
"v57.0.0": ["@typescript-eslint/init-declarations", "@typescript-eslint/no-empty-function"],
|
479
|
+
"v58.0.0": ["@typescript-eslint/no-explicit-any"],
|
480
|
+
"v64.0.0": ["@typescript-eslint/no-deprecated"],
|
481
|
+
"v65.0.0": ["@typescript-eslint/no-magic-numbers"],
|
482
|
+
"v70.0.0": ["@typescript-eslint/no-unnecessary-condition"],
|
483
|
+
"v75.0.0": ["@typescript-eslint/no-unnecessary-type-parameters"],
|
484
|
+
"v76.0.0": ["@typescript-eslint/no-unsafe-assignment"],
|
485
|
+
"v77.0.0": ["@typescript-eslint/no-unsafe-call"],
|
486
|
+
"v79.0.0": ["@typescript-eslint/no-unsafe-enum-comparison"],
|
487
|
+
"v80.0.0": ["@typescript-eslint/no-unsafe-member-access"],
|
488
|
+
"v81.0.0": ["@typescript-eslint/no-unsafe-return"],
|
489
|
+
"v82.0.0": ["@typescript-eslint/no-unsafe-unary-minus"],
|
490
|
+
"v89.0.0": ["@typescript-eslint/prefer-destructuring"]
|
491
|
+
};
|
234
492
|
}
|
235
493
|
|
236
|
-
|
237
|
-
|
238
|
-
var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"));
|
239
|
-
var import_eslint_plugin_prefer_arrow_functions = __toESM(require("eslint-plugin-prefer-arrow-functions"));
|
240
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"));
|
241
|
-
var import_eslint_utils = require("@agilebot/eslint-utils");
|
494
|
+
//#endregion
|
495
|
+
//#region src/configs/ts.ts
|
242
496
|
function ts() {
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
"@typescript-eslint/no-misused-promises": [
|
335
|
-
"error",
|
336
|
-
{
|
337
|
-
checksVoidReturn: false
|
338
|
-
}
|
339
|
-
],
|
340
|
-
"@typescript-eslint/no-deprecated": "error"
|
341
|
-
}
|
342
|
-
};
|
497
|
+
return {
|
498
|
+
name: "agilebot/ts",
|
499
|
+
files: require_constants.DEFAULT_GLOBS,
|
500
|
+
plugins: {
|
501
|
+
"@typescript-eslint": __typescript_eslint_eslint_plugin,
|
502
|
+
"@stylistic": __stylistic_eslint_plugin.default,
|
503
|
+
"prefer-arrow-functions": eslint_plugin_prefer_arrow_functions.default,
|
504
|
+
"unused-imports": eslint_plugin_unused_imports.default,
|
505
|
+
"react-edge": eslint_plugin_react_edge.default
|
506
|
+
},
|
507
|
+
rules: {
|
508
|
+
"@stylistic/quotes": [
|
509
|
+
"error",
|
510
|
+
"single",
|
511
|
+
{ avoidEscape: true }
|
512
|
+
],
|
513
|
+
"prefer-arrow-functions/prefer-arrow-functions": ["warn", {
|
514
|
+
allowNamedFunctions: true,
|
515
|
+
classPropertiesAllowed: false,
|
516
|
+
disallowPrototype: false,
|
517
|
+
returnStyle: "unchanged",
|
518
|
+
singleReturnOnly: false
|
519
|
+
}],
|
520
|
+
"@typescript-eslint/no-unused-vars": "off",
|
521
|
+
"unused-imports/no-unused-imports": (0, __agilebot_eslint_utils.isInEditor)() ? "off" : "error",
|
522
|
+
"unused-imports/no-unused-vars": ["warn", {
|
523
|
+
args: "after-used",
|
524
|
+
argsIgnorePattern: "^_",
|
525
|
+
vars: "all",
|
526
|
+
varsIgnorePattern: "^_",
|
527
|
+
caughtErrors: "none",
|
528
|
+
caughtErrorsIgnorePattern: "^_",
|
529
|
+
destructuredArrayIgnorePattern: "^_",
|
530
|
+
ignoreRestSiblings: true
|
531
|
+
}],
|
532
|
+
"@typescript-eslint/consistent-type-definitions": "error",
|
533
|
+
"@typescript-eslint/naming-convention": [
|
534
|
+
"error",
|
535
|
+
{
|
536
|
+
selector: "function",
|
537
|
+
format: ["camelCase", "PascalCase"]
|
538
|
+
},
|
539
|
+
{
|
540
|
+
selector: "variable",
|
541
|
+
types: ["function"],
|
542
|
+
format: ["camelCase", "PascalCase"]
|
543
|
+
},
|
544
|
+
{
|
545
|
+
selector: "typeLike",
|
546
|
+
format: ["PascalCase"]
|
547
|
+
},
|
548
|
+
{
|
549
|
+
selector: "parameter",
|
550
|
+
format: ["camelCase"],
|
551
|
+
leadingUnderscore: "allow"
|
552
|
+
},
|
553
|
+
{
|
554
|
+
selector: "method",
|
555
|
+
format: ["camelCase"]
|
556
|
+
},
|
557
|
+
{
|
558
|
+
selector: "classProperty",
|
559
|
+
format: [
|
560
|
+
"camelCase",
|
561
|
+
"UPPER_CASE",
|
562
|
+
"PascalCase"
|
563
|
+
],
|
564
|
+
leadingUnderscore: "allow"
|
565
|
+
},
|
566
|
+
{
|
567
|
+
selector: "typeProperty",
|
568
|
+
format: ["camelCase"]
|
569
|
+
},
|
570
|
+
{
|
571
|
+
selector: "enum",
|
572
|
+
format: ["PascalCase"]
|
573
|
+
},
|
574
|
+
{
|
575
|
+
selector: "enumMember",
|
576
|
+
format: ["PascalCase", "UPPER_CASE"]
|
577
|
+
}
|
578
|
+
],
|
579
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
580
|
+
"@typescript-eslint/require-await": "error",
|
581
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
582
|
+
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
583
|
+
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
|
584
|
+
"@typescript-eslint/no-deprecated": "error",
|
585
|
+
"react-edge/var-naming": "error"
|
586
|
+
}
|
587
|
+
};
|
343
588
|
}
|
344
589
|
function tsOnly() {
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
590
|
+
return {
|
591
|
+
name: "agilebot/ts-only",
|
592
|
+
files: require_constants.TS_GLOBS,
|
593
|
+
rules: {
|
594
|
+
"prefer-object-has-own": "error",
|
595
|
+
"@typescript-eslint/explicit-member-accessibility": "error"
|
596
|
+
}
|
597
|
+
};
|
353
598
|
}
|
354
599
|
function jsOnly() {
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
}
|
361
|
-
};
|
600
|
+
return {
|
601
|
+
name: "agilebot/js-only",
|
602
|
+
files: require_constants.JS_GLOBS,
|
603
|
+
rules: { "@typescript-eslint/no-require-imports": "off" }
|
604
|
+
};
|
362
605
|
}
|
363
606
|
function dts() {
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
"@typescript-eslint/triple-slash-reference": "off"
|
374
|
-
}
|
375
|
-
};
|
607
|
+
return {
|
608
|
+
name: "agilebot/dts",
|
609
|
+
files: require_constants.DTS_GLOBS,
|
610
|
+
rules: {
|
611
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
612
|
+
"@typescript-eslint/naming-convention": "off",
|
613
|
+
"@typescript-eslint/triple-slash-reference": "off"
|
614
|
+
}
|
615
|
+
};
|
376
616
|
}
|
377
617
|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
618
|
+
//#endregion
|
619
|
+
//#region src/configs/imports.ts
|
620
|
+
/**
|
621
|
+
* eslint-plugin-import 规则
|
622
|
+
* @param packageDir 子包路径
|
623
|
+
* @param opts 参数
|
624
|
+
*/
|
384
625
|
function imports(packageDir, opts) {
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
"parent",
|
468
|
-
"sibling",
|
469
|
-
"index",
|
470
|
-
"object"
|
471
|
-
],
|
472
|
-
pathGroups: [
|
473
|
-
{
|
474
|
-
pattern: `${pkg.name}/**`,
|
475
|
-
group: "parent",
|
476
|
-
position: "after"
|
477
|
-
}
|
478
|
-
],
|
479
|
-
"newlines-between": "always",
|
480
|
-
distinctGroup: false
|
481
|
-
}
|
482
|
-
],
|
483
|
-
"no-relative-import-paths/no-relative-import-paths": opts.allowRelativePaths ? "off" : ["warn", { allowSameFolder: true }]
|
484
|
-
},
|
485
|
-
settings: {
|
486
|
-
"import-x/parsers": {
|
487
|
-
"@typescript-eslint/parser": [".ts", ".tsx"]
|
488
|
-
},
|
489
|
-
"import-x/resolver": opts.resolver === "oxc" ? {
|
490
|
-
oxc: true
|
491
|
-
} : {
|
492
|
-
typescript: {
|
493
|
-
alwaysTryTypes: true
|
494
|
-
}
|
495
|
-
},
|
496
|
-
"import-x/internal-regex": opts.monorepoScope ? `^${opts.monorepoScope.replace(/\//g, "")}/` : void 0,
|
497
|
-
"import-x/core-modules": opts.coreModules ?? void 0
|
498
|
-
}
|
499
|
-
};
|
626
|
+
const rootDir = (0, __agilebot_eslint_utils.findRootDir)(__dirname);
|
627
|
+
const pkgPath = node_path.default.join(packageDir, "package.json");
|
628
|
+
if (!node_fs.default.existsSync(pkgPath)) throw new Error(`package.json not found in ${packageDir}`);
|
629
|
+
const pkg = JSON.parse(node_fs.default.readFileSync(pkgPath, "utf8"));
|
630
|
+
const tmpPkg = {
|
631
|
+
name: `${pkg.name}/tmp`,
|
632
|
+
dependencies: { [pkg.name]: "*" }
|
633
|
+
};
|
634
|
+
const tmpPkgSafeName = tmpPkg.name.replace(/\//g, "__");
|
635
|
+
const cacheDir = (0, __agilebot_eslint_utils.findCacheDir)(rootDir);
|
636
|
+
const tmpPkgDir = node_path.default.join(cacheDir, "tmp-pkg", tmpPkgSafeName);
|
637
|
+
if (!node_fs.default.existsSync(tmpPkgDir)) node_fs.default.mkdirSync(tmpPkgDir, { recursive: true });
|
638
|
+
const tmpPkgJson = JSON.stringify(tmpPkg, null, 2);
|
639
|
+
node_fs.default.writeFileSync(node_path.default.join(tmpPkgDir, "package.json"), tmpPkgJson);
|
640
|
+
return {
|
641
|
+
name: "agilebot/imports",
|
642
|
+
files: require_constants.DEFAULT_GLOBS,
|
643
|
+
plugins: {
|
644
|
+
"import-x": eslint_plugin_import_x.default,
|
645
|
+
"no-relative-import-paths": eslint_plugin_no_relative_import_paths.default
|
646
|
+
},
|
647
|
+
rules: {
|
648
|
+
...eslint_plugin_import_x.default.configs.recommended.rules,
|
649
|
+
...eslint_plugin_import_x.default.configs.typescript.rules,
|
650
|
+
"import-x/no-unresolved": ["error", { ignore: [String.raw`\?(react|raw|url|inline|worker|worker&inline|worker&url|sharedworker|sharedworker&inline|sharedworker&url)$`] }],
|
651
|
+
"import-x/no-named-as-default-member": "off",
|
652
|
+
"import-x/no-named-as-default": "off",
|
653
|
+
"import-x/no-useless-path-segments": ["error", { noUselessIndex: true }],
|
654
|
+
"import-x/no-cycle": (0, __agilebot_eslint_utils.isInEditor)() ? "off" : "error",
|
655
|
+
"import-x/newline-after-import": "error",
|
656
|
+
"import-x/first": "error",
|
657
|
+
"import-x/no-import-module-exports": "error",
|
658
|
+
"import-x/no-anonymous-default-export": ["error", {
|
659
|
+
allowArray: true,
|
660
|
+
allowObject: true
|
661
|
+
}],
|
662
|
+
"import-x/no-extraneous-dependencies": opts.allowExtraneousDependencies ? "off" : ["error", {
|
663
|
+
packageDir: [
|
664
|
+
packageDir,
|
665
|
+
tmpPkgDir,
|
666
|
+
rootDir
|
667
|
+
],
|
668
|
+
devDependencies: [
|
669
|
+
"test/**/*",
|
670
|
+
"tests/**/*",
|
671
|
+
"**/__tests__/**",
|
672
|
+
"**/*.test.{ts,tsx,js,jsx,cjs,mjs,mts,cts}",
|
673
|
+
"**/*.config.{ts,js,cjs,mjs,mts,cts}",
|
674
|
+
"**/.storybook/**",
|
675
|
+
"**/*.stories.{ts,tsx}",
|
676
|
+
"**/scripts/*.{ts,mts}",
|
677
|
+
...opts.devDependencies ?? []
|
678
|
+
],
|
679
|
+
includeInternal: true
|
680
|
+
}],
|
681
|
+
"import-x/order": ["error", {
|
682
|
+
groups: [
|
683
|
+
"builtin",
|
684
|
+
"external",
|
685
|
+
"internal",
|
686
|
+
"parent",
|
687
|
+
"sibling",
|
688
|
+
"index",
|
689
|
+
"object"
|
690
|
+
],
|
691
|
+
pathGroups: [{
|
692
|
+
pattern: `${pkg.name}/**`,
|
693
|
+
group: "parent",
|
694
|
+
position: "after"
|
695
|
+
}],
|
696
|
+
"newlines-between": "always",
|
697
|
+
distinctGroup: false
|
698
|
+
}],
|
699
|
+
"no-relative-import-paths/no-relative-import-paths": opts.allowRelativePaths ? "off" : ["warn", { allowSameFolder: true }]
|
700
|
+
},
|
701
|
+
settings: {
|
702
|
+
"import-x/parsers": { "@typescript-eslint/parser": [".ts", ".tsx"] },
|
703
|
+
"import-x/resolver": opts.resolver === "oxc" ? { oxc: true } : { typescript: { alwaysTryTypes: true } },
|
704
|
+
"import-x/internal-regex": opts.monorepoScope ? `^${opts.monorepoScope.replace(/\//g, "")}/` : void 0,
|
705
|
+
"import-x/core-modules": opts.coreModules ?? void 0
|
706
|
+
}
|
707
|
+
};
|
500
708
|
}
|
501
709
|
|
502
|
-
|
503
|
-
|
710
|
+
//#endregion
|
711
|
+
//#region src/configs/unicorn.ts
|
504
712
|
function unicorn(opts) {
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
{
|
538
|
-
name: "err"
|
539
|
-
}
|
540
|
-
],
|
541
|
-
"unicorn/prefer-global-this": "off"
|
542
|
-
}
|
543
|
-
};
|
713
|
+
return {
|
714
|
+
name: "agilebot/unicorn",
|
715
|
+
files: require_constants.DEFAULT_GLOBS,
|
716
|
+
plugins: { unicorn: eslint_plugin_unicorn.default },
|
717
|
+
rules: {
|
718
|
+
...eslint_plugin_unicorn.default.configs["flat/recommended"].rules,
|
719
|
+
"unicorn/prefer-module": opts.module ? "error" : "off",
|
720
|
+
"unicorn/prefer-top-level-await": "off",
|
721
|
+
"unicorn/filename-case": "off",
|
722
|
+
"unicorn/import-style": "off",
|
723
|
+
"unicorn/prefer-at": "off",
|
724
|
+
"unicorn/prevent-abbreviations": "off",
|
725
|
+
"unicorn/prefer-date-now": "off",
|
726
|
+
"unicorn/no-process-exit": "off",
|
727
|
+
"unicorn/no-null": "off",
|
728
|
+
"unicorn/consistent-function-scoping": "off",
|
729
|
+
"unicorn/numeric-separators-style": "off",
|
730
|
+
"unicorn/prefer-optional-catch-binding": "off",
|
731
|
+
"unicorn/no-negated-condition": "off",
|
732
|
+
"unicorn/switch-case-braces": "off",
|
733
|
+
"unicorn/no-array-for-each": "off",
|
734
|
+
"unicorn/prefer-ternary": "off",
|
735
|
+
"unicorn/better-regex": "off",
|
736
|
+
"unicorn/error-message": "off",
|
737
|
+
"unicorn/no-object-as-default-parameter": "off",
|
738
|
+
"unicorn/no-array-push-push": "off",
|
739
|
+
"unicorn/no-useless-undefined": "off",
|
740
|
+
"unicorn/prefer-blob-reading-methods": "off",
|
741
|
+
"unicorn/catch-error-name": ["error", { name: "err" }],
|
742
|
+
"unicorn/prefer-global-this": "off"
|
743
|
+
}
|
744
|
+
};
|
544
745
|
}
|
545
746
|
|
546
|
-
|
547
|
-
|
548
|
-
var import_eslint_plugin3 = __toESM(require("@eslint-react/eslint-plugin"));
|
549
|
-
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"));
|
550
|
-
var import_eslint_plugin_jsx_a11y = __toESM(require("eslint-plugin-jsx-a11y"));
|
551
|
-
var import_eslint_plugin4 = __toESM(require("@stylistic/eslint-plugin"));
|
552
|
-
var import_eslint_plugin5 = __toESM(require("@agilebot/eslint-plugin"));
|
747
|
+
//#endregion
|
748
|
+
//#region src/configs/react.ts
|
553
749
|
function react(opts) {
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
{
|
634
|
-
eventHandlerPrefix: "handle",
|
635
|
-
eventHandlerPropPrefix: "on",
|
636
|
-
checkLocalVariables: true
|
637
|
-
}
|
638
|
-
],
|
639
|
-
// Stylistic rules are not supported by @eslint-react. Use dprint or @stylistic instead.
|
640
|
-
"@stylistic/jsx-self-closing-comp": "error",
|
641
|
-
// <App prop={'Hello'} />没必要,使用<App prop="Hello" />
|
642
|
-
"@stylistic/jsx-curly-brace-presence": [
|
643
|
-
"error",
|
644
|
-
{
|
645
|
-
props: "never",
|
646
|
-
children: "never",
|
647
|
-
propElementValues: "always"
|
648
|
-
}
|
649
|
-
],
|
650
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
651
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
652
|
-
"jsx-a11y/alt-text": "off"
|
653
|
-
},
|
654
|
-
settings: {
|
655
|
-
react: {
|
656
|
-
version: typeof opts.version === "string" ? opts.version : "detect"
|
657
|
-
}
|
658
|
-
}
|
659
|
-
};
|
750
|
+
return {
|
751
|
+
name: "agilebot/react",
|
752
|
+
files: require_constants.DEFAULT_GLOBS,
|
753
|
+
plugins: {
|
754
|
+
react: eslint_plugin_react.default,
|
755
|
+
"react-hooks": eslint_plugin_react_hooks.default,
|
756
|
+
"jsx-a11y": eslint_plugin_jsx_a11y.default,
|
757
|
+
...__eslint_react_eslint_plugin.default.configs.recommended.plugins,
|
758
|
+
"@stylistic": __stylistic_eslint_plugin.default,
|
759
|
+
"@agilebot": __agilebot_eslint_plugin.default,
|
760
|
+
"react-edge": eslint_plugin_react_edge.default
|
761
|
+
},
|
762
|
+
rules: {
|
763
|
+
...eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules,
|
764
|
+
"@eslint-react/no-direct-mutation-state": "error",
|
765
|
+
"@eslint-react/no-children-prop": "error",
|
766
|
+
"@eslint-react/no-children-to-array": "warn",
|
767
|
+
"@eslint-react/no-clone-element": "warn",
|
768
|
+
"@eslint-react/no-class-component": "error",
|
769
|
+
"@eslint-react/no-string-refs": "error",
|
770
|
+
"@eslint-react/no-missing-key": "error",
|
771
|
+
"@eslint-react/no-array-index-key": "warn",
|
772
|
+
"@eslint-react/no-duplicate-key": "error",
|
773
|
+
"@eslint-react/no-comment-textnodes": "error",
|
774
|
+
"@eslint-react/no-component-will-mount": "error",
|
775
|
+
"@eslint-react/no-component-will-receive-props": "error",
|
776
|
+
"@eslint-react/no-component-will-update": "error",
|
777
|
+
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
778
|
+
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
779
|
+
"@eslint-react/no-unsafe-component-will-update": "warn",
|
780
|
+
"@eslint-react/ensure-forward-ref-using-ref": "warn",
|
781
|
+
"@eslint-react/no-create-ref": "error",
|
782
|
+
"@eslint-react/no-nested-components": "warn",
|
783
|
+
"@eslint-react/no-redundant-should-component-update": "error",
|
784
|
+
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
785
|
+
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
786
|
+
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
787
|
+
"@eslint-react/prefer-shorthand-boolean": "error",
|
788
|
+
"@eslint-react/no-access-state-in-setstate": "error",
|
789
|
+
"@eslint-react/prefer-shorthand-fragment": "error",
|
790
|
+
"@eslint-react/no-missing-component-display-name": "error",
|
791
|
+
"@eslint-react/no-prop-types": "error",
|
792
|
+
"@eslint-react/no-useless-fragment": ["error", { allowExpressions: true }],
|
793
|
+
"@eslint-react/jsx-uses-vars": "error",
|
794
|
+
"@eslint-react/jsx-no-duplicate-props": "error",
|
795
|
+
"@eslint-react/dom/no-children-in-void-dom-elements": "error",
|
796
|
+
"@eslint-react/dom/no-unsafe-target-blank": "error",
|
797
|
+
"@eslint-react/dom/no-dangerously-set-innerhtml": "error",
|
798
|
+
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
799
|
+
"@eslint-react/dom/no-find-dom-node": "error",
|
800
|
+
"@eslint-react/dom/no-render-return-value": "error",
|
801
|
+
"@eslint-react/dom/no-unknown-property": "error",
|
802
|
+
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
803
|
+
"react-hooks/rules-of-hooks": "error",
|
804
|
+
"@eslint-react/naming-convention/component-name": "error",
|
805
|
+
"@eslint-react/naming-convention/context-name": "error",
|
806
|
+
"@eslint-react/naming-convention/use-state": "error",
|
807
|
+
"@eslint-react/web-api/no-leaked-interval": "warn",
|
808
|
+
"@eslint-react/web-api/no-leaked-timeout": "warn",
|
809
|
+
"@eslint-react/web-api/no-leaked-event-listener": "warn",
|
810
|
+
"@eslint-react/web-api/no-leaked-resize-observer": "warn",
|
811
|
+
"react/jsx-handler-names": ["error", {
|
812
|
+
eventHandlerPrefix: "handle",
|
813
|
+
eventHandlerPropPrefix: "on",
|
814
|
+
checkLocalVariables: true
|
815
|
+
}],
|
816
|
+
"@stylistic/jsx-self-closing-comp": "error",
|
817
|
+
"@stylistic/jsx-curly-brace-presence": ["error", {
|
818
|
+
props: "never",
|
819
|
+
children: "never",
|
820
|
+
propElementValues: "always"
|
821
|
+
}],
|
822
|
+
"jsx-a11y/click-events-have-key-events": "off",
|
823
|
+
"jsx-a11y/no-static-element-interactions": "off",
|
824
|
+
"jsx-a11y/alt-text": "off",
|
825
|
+
"react-edge/prefer-named-property-access": "error"
|
826
|
+
},
|
827
|
+
settings: { react: { version: typeof opts.version === "string" ? opts.version : "detect" } }
|
828
|
+
};
|
660
829
|
}
|
661
830
|
function reactJsOnly() {
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
};
|
831
|
+
return {
|
832
|
+
name: "agilebot/react-js-only",
|
833
|
+
files: require_constants.JS_GLOBS,
|
834
|
+
rules: {
|
835
|
+
"react/jsx-no-duplicate-props": "error",
|
836
|
+
"react/jsx-no-undef": "error",
|
837
|
+
"react/jsx-uses-react": "error",
|
838
|
+
"react/no-unescaped-entities": "error",
|
839
|
+
"react/react-in-jsx-scope": "error",
|
840
|
+
"react/require-render-return": "error"
|
841
|
+
}
|
842
|
+
};
|
675
843
|
}
|
676
844
|
|
677
|
-
|
678
|
-
|
845
|
+
//#endregion
|
846
|
+
//#region src/configs/vue.ts
|
679
847
|
function vue(opts) {
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
rules: {
|
687
|
-
...opts.version === 3 ? import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules : import_eslint_plugin_vue.default.configs["strongly-recommended"].rules
|
688
|
-
}
|
689
|
-
};
|
848
|
+
return {
|
849
|
+
name: "agilebot/vue",
|
850
|
+
files: require_constants.VUE_GLOBS,
|
851
|
+
plugins: { vue: eslint_plugin_vue.default },
|
852
|
+
rules: { ...opts.version === 3 ? eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules : eslint_plugin_vue.default.configs["strongly-recommended"].rules }
|
853
|
+
};
|
690
854
|
}
|
691
855
|
|
692
|
-
|
693
|
-
|
856
|
+
//#endregion
|
857
|
+
//#region src/configs/jsdoc.ts
|
694
858
|
function jsdoc(opt) {
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
"error",
|
710
|
-
{
|
711
|
-
typed: opt.ts
|
712
|
-
}
|
713
|
-
],
|
714
|
-
"jsdoc/require-returns": "off",
|
715
|
-
// @return注释不是很有必要
|
716
|
-
"jsdoc/require-returns-type": "off"
|
717
|
-
}
|
718
|
-
};
|
719
|
-
}
|
720
|
-
|
721
|
-
// src/configs/lodash.ts
|
722
|
-
var import_eslint_plugin_you_dont_need_lodash_underscore = __toESM(require("eslint-plugin-you-dont-need-lodash-underscore"));
|
723
|
-
|
724
|
-
// ../../node_modules/.pnpm/@eslint+compat@1.2.7_eslint@9.21.0_jiti@2.4.2_/node_modules/@eslint/compat/dist/esm/index.js
|
725
|
-
var import_node_fs2 = __toESM(require("fs"), 1);
|
726
|
-
var import_node_path2 = __toESM(require("path"), 1);
|
727
|
-
var removedMethodNames = /* @__PURE__ */ new Map([
|
728
|
-
["getSource", "getText"],
|
729
|
-
["getSourceLines", "getLines"],
|
730
|
-
["getAllComments", "getAllComments"],
|
731
|
-
["getDeclaredVariables", "getDeclaredVariables"],
|
732
|
-
["getNodeByRangeIndex", "getNodeByRangeIndex"],
|
733
|
-
["getCommentsBefore", "getCommentsBefore"],
|
734
|
-
["getCommentsAfter", "getCommentsAfter"],
|
735
|
-
["getCommentsInside", "getCommentsInside"],
|
736
|
-
["getJSDocComment", "getJSDocComment"],
|
737
|
-
["getFirstToken", "getFirstToken"],
|
738
|
-
["getFirstTokens", "getFirstTokens"],
|
739
|
-
["getLastToken", "getLastToken"],
|
740
|
-
["getLastTokens", "getLastTokens"],
|
741
|
-
["getTokenAfter", "getTokenAfter"],
|
742
|
-
["getTokenBefore", "getTokenBefore"],
|
743
|
-
["getTokenByRangeStart", "getTokenByRangeStart"],
|
744
|
-
["getTokens", "getTokens"],
|
745
|
-
["getTokensAfter", "getTokensAfter"],
|
746
|
-
["getTokensBefore", "getTokensBefore"],
|
747
|
-
["getTokensBetween", "getTokensBetween"]
|
748
|
-
]);
|
749
|
-
var fixedUpRuleReplacements = /* @__PURE__ */ new WeakMap();
|
750
|
-
var fixedUpRules = /* @__PURE__ */ new WeakSet();
|
751
|
-
var fixedUpPluginReplacements = /* @__PURE__ */ new WeakMap();
|
752
|
-
var fixedUpPlugins = /* @__PURE__ */ new WeakSet();
|
753
|
-
function fixupRule(ruleDefinition) {
|
754
|
-
if (fixedUpRuleReplacements.has(ruleDefinition)) {
|
755
|
-
return fixedUpRuleReplacements.get(ruleDefinition);
|
756
|
-
}
|
757
|
-
const isLegacyRule = typeof ruleDefinition === "function";
|
758
|
-
if (!isLegacyRule && fixedUpRules.has(ruleDefinition)) {
|
759
|
-
return ruleDefinition;
|
760
|
-
}
|
761
|
-
const originalCreate = isLegacyRule ? ruleDefinition : ruleDefinition.create.bind(ruleDefinition);
|
762
|
-
function ruleCreate(context) {
|
763
|
-
if ("getScope" in context) {
|
764
|
-
return originalCreate(context);
|
765
|
-
}
|
766
|
-
const sourceCode = context.sourceCode;
|
767
|
-
let currentNode = sourceCode.ast;
|
768
|
-
const newContext = Object.assign(Object.create(context), {
|
769
|
-
parserServices: sourceCode.parserServices,
|
770
|
-
/*
|
771
|
-
* The following methods rely on the current node in the traversal,
|
772
|
-
* so we need to add them manually.
|
773
|
-
*/
|
774
|
-
getScope() {
|
775
|
-
return sourceCode.getScope(currentNode);
|
776
|
-
},
|
777
|
-
getAncestors() {
|
778
|
-
return sourceCode.getAncestors(currentNode);
|
779
|
-
},
|
780
|
-
markVariableAsUsed(variable) {
|
781
|
-
sourceCode.markVariableAsUsed(variable, currentNode);
|
782
|
-
}
|
783
|
-
});
|
784
|
-
for (const [
|
785
|
-
contextMethodName,
|
786
|
-
sourceCodeMethodName
|
787
|
-
] of removedMethodNames) {
|
788
|
-
newContext[contextMethodName] = sourceCode[sourceCodeMethodName].bind(sourceCode);
|
789
|
-
}
|
790
|
-
Object.freeze(newContext);
|
791
|
-
const visitor = originalCreate(newContext);
|
792
|
-
for (const [methodName, method] of Object.entries(visitor)) {
|
793
|
-
if (methodName.startsWith("on")) {
|
794
|
-
visitor[methodName] = (...args) => {
|
795
|
-
currentNode = args[methodName === "onCodePathSegmentLoop" ? 2 : 1];
|
796
|
-
return method.call(visitor, ...args);
|
797
|
-
};
|
798
|
-
continue;
|
799
|
-
}
|
800
|
-
visitor[methodName] = (...args) => {
|
801
|
-
currentNode = args[0];
|
802
|
-
return method.call(visitor, ...args);
|
803
|
-
};
|
804
|
-
}
|
805
|
-
return visitor;
|
806
|
-
}
|
807
|
-
const newRuleDefinition = {
|
808
|
-
...isLegacyRule ? void 0 : ruleDefinition,
|
809
|
-
create: ruleCreate
|
810
|
-
};
|
811
|
-
const { schema } = ruleDefinition;
|
812
|
-
if (schema) {
|
813
|
-
if (!newRuleDefinition.meta) {
|
814
|
-
newRuleDefinition.meta = { schema };
|
815
|
-
} else {
|
816
|
-
newRuleDefinition.meta = {
|
817
|
-
...newRuleDefinition.meta,
|
818
|
-
// top-level `schema` had precedence over `meta.schema` so it's okay to overwrite `meta.schema` if it exists
|
819
|
-
schema
|
820
|
-
};
|
821
|
-
}
|
822
|
-
}
|
823
|
-
fixedUpRuleReplacements.set(ruleDefinition, newRuleDefinition);
|
824
|
-
fixedUpRules.add(newRuleDefinition);
|
825
|
-
return newRuleDefinition;
|
826
|
-
}
|
827
|
-
function fixupPluginRules(plugin) {
|
828
|
-
if (fixedUpPluginReplacements.has(plugin)) {
|
829
|
-
return fixedUpPluginReplacements.get(plugin);
|
830
|
-
}
|
831
|
-
if (fixedUpPlugins.has(plugin) || !plugin.rules) {
|
832
|
-
return plugin;
|
833
|
-
}
|
834
|
-
const newPlugin = {
|
835
|
-
...plugin,
|
836
|
-
rules: Object.fromEntries(
|
837
|
-
Object.entries(plugin.rules).map(([ruleId, ruleDefinition]) => [
|
838
|
-
ruleId,
|
839
|
-
fixupRule(ruleDefinition)
|
840
|
-
])
|
841
|
-
)
|
842
|
-
};
|
843
|
-
fixedUpPluginReplacements.set(plugin, newPlugin);
|
844
|
-
fixedUpPlugins.add(newPlugin);
|
845
|
-
return newPlugin;
|
859
|
+
return {
|
860
|
+
name: "agilebot/jsdoc",
|
861
|
+
files: require_constants.DEFAULT_GLOBS,
|
862
|
+
plugins: { jsdoc: eslint_plugin_jsdoc.default },
|
863
|
+
rules: {
|
864
|
+
...opt.ts ? eslint_plugin_jsdoc.default.configs["flat/recommended-typescript-error"].rules : eslint_plugin_jsdoc.default.configs["flat/recommended-error"].rules,
|
865
|
+
"jsdoc/no-blank-block-descriptions": "error",
|
866
|
+
"jsdoc/no-blank-blocks": "error",
|
867
|
+
"jsdoc/require-asterisk-prefix": "error",
|
868
|
+
"jsdoc/check-tag-names": ["error", { typed: opt.ts }],
|
869
|
+
"jsdoc/require-returns": "off",
|
870
|
+
"jsdoc/require-returns-type": "off"
|
871
|
+
}
|
872
|
+
};
|
846
873
|
}
|
847
874
|
|
848
|
-
|
875
|
+
//#endregion
|
876
|
+
//#region src/configs/lodash.ts
|
849
877
|
function lodash() {
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
"you-dont-need-lodash-underscore/throttle": "off"
|
860
|
-
}
|
861
|
-
};
|
878
|
+
return {
|
879
|
+
name: "agilebot/lodash",
|
880
|
+
files: require_constants.DEFAULT_GLOBS,
|
881
|
+
plugins: { "you-dont-need-lodash-underscore": (0, __eslint_compat.fixupPluginRules)(eslint_plugin_you_dont_need_lodash_underscore.default) },
|
882
|
+
rules: {
|
883
|
+
...eslint_plugin_you_dont_need_lodash_underscore.default.configs["all-warn"].rules,
|
884
|
+
"you-dont-need-lodash-underscore/throttle": "off"
|
885
|
+
}
|
886
|
+
};
|
862
887
|
}
|
863
888
|
|
864
|
-
|
865
|
-
|
889
|
+
//#endregion
|
890
|
+
//#region src/configs/comments.ts
|
866
891
|
function comments() {
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
"error",
|
885
|
-
{
|
886
|
-
ignore: ["eslint-env", "exported", "global", "globals"]
|
887
|
-
}
|
888
|
-
]
|
889
|
-
}
|
890
|
-
};
|
892
|
+
return {
|
893
|
+
name: "agilebot/comments",
|
894
|
+
files: require_constants.DEFAULT_GLOBS,
|
895
|
+
plugins: { "@eslint-community/eslint-comments": __eslint_community_eslint_plugin_eslint_comments.default },
|
896
|
+
rules: {
|
897
|
+
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
898
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": "error",
|
899
|
+
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
|
900
|
+
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
|
901
|
+
"@eslint-community/eslint-comments/require-description": ["error", { ignore: [
|
902
|
+
"eslint-env",
|
903
|
+
"exported",
|
904
|
+
"global",
|
905
|
+
"globals"
|
906
|
+
] }]
|
907
|
+
}
|
908
|
+
};
|
891
909
|
}
|
892
910
|
|
893
|
-
|
894
|
-
|
911
|
+
//#endregion
|
912
|
+
//#region src/configs/cspell.ts
|
895
913
|
function cspell(opts) {
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
checkComments: false,
|
907
|
-
autoFix: false,
|
908
|
-
cspell: opts
|
909
|
-
}
|
910
|
-
]
|
911
|
-
}
|
912
|
-
};
|
914
|
+
return {
|
915
|
+
name: "agilebot/cspell",
|
916
|
+
files: require_constants.DEFAULT_GLOBS,
|
917
|
+
plugins: { "@cspell": __cspell_eslint_plugin.default },
|
918
|
+
rules: { "@cspell/spellchecker": ["warn", {
|
919
|
+
checkComments: false,
|
920
|
+
autoFix: false,
|
921
|
+
cspell: opts
|
922
|
+
}] }
|
923
|
+
};
|
913
924
|
}
|
914
925
|
|
915
|
-
|
916
|
-
|
917
|
-
var import_eslint_plugin7 = __toESM(require("@agilebot/eslint-plugin"));
|
926
|
+
//#endregion
|
927
|
+
//#region src/configs/agilebot.ts
|
918
928
|
function agilebot(opts) {
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
929
|
+
return {
|
930
|
+
name: "agilebot/agilebot",
|
931
|
+
files: require_constants.DEFAULT_GLOBS,
|
932
|
+
plugins: {
|
933
|
+
"@agilebot": __agilebot_eslint_plugin.default,
|
934
|
+
"react-hooks": eslint_plugin_react_hooks.default
|
935
|
+
},
|
936
|
+
rules: {
|
937
|
+
...__agilebot_eslint_plugin.default.configs.recommended.rules,
|
938
|
+
"react-hooks/exhaustive-deps": "off",
|
939
|
+
"@agilebot/react-better-exhaustive-deps": "warn"
|
940
|
+
},
|
941
|
+
settings: {
|
942
|
+
"agilebot/project-root": opts.root,
|
943
|
+
"agilebot/monorepo-scope": opts.monorepoScope ? opts.monorepoScope.replace(/\//g, "") : void 0
|
944
|
+
}
|
945
|
+
};
|
936
946
|
}
|
937
947
|
|
938
|
-
|
939
|
-
|
940
|
-
|
948
|
+
//#endregion
|
949
|
+
//#region ../prettier-config/dist/index.mjs
|
950
|
+
/**
|
951
|
+
|
952
|
+
* @license @agilebot/prettier-config v0.8.2
|
953
|
+
|
954
|
+
*
|
955
|
+
|
956
|
+
* Copyright (c) Agilebot, Inc. and its affiliates.
|
941
957
|
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
958
|
+
*
|
959
|
+
|
960
|
+
* This source code is licensed under the MIT license found in the
|
961
|
+
|
962
|
+
* LICENSE file in the root directory of this source tree.
|
963
|
+
|
964
|
+
*/
|
965
|
+
const config = {
|
966
|
+
tabWidth: 2,
|
967
|
+
singleQuote: true,
|
968
|
+
trailingComma: "none",
|
969
|
+
bracketSpacing: true,
|
970
|
+
bracketSameLine: true,
|
971
|
+
useTabs: false,
|
972
|
+
arrowParens: "avoid"
|
951
973
|
};
|
952
|
-
var
|
974
|
+
var src_default = config;
|
953
975
|
|
954
|
-
|
976
|
+
//#endregion
|
977
|
+
//#region src/configs/prettier.ts
|
955
978
|
function prettier(opts) {
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
{
|
976
|
-
usePrettierrc: !opts
|
977
|
-
}
|
978
|
-
]
|
979
|
-
}
|
980
|
-
};
|
979
|
+
return {
|
980
|
+
name: "agilebot/prettier",
|
981
|
+
files: require_constants.DEFAULT_GLOBS,
|
982
|
+
plugins: { prettier: eslint_plugin_prettier.default },
|
983
|
+
rules: {
|
984
|
+
...eslint_plugin_prettier_recommended.default.rules,
|
985
|
+
curly: "error",
|
986
|
+
"arrow-body-style": "off",
|
987
|
+
"prettier/prettier": [
|
988
|
+
"error",
|
989
|
+
{
|
990
|
+
endOfLine: "auto",
|
991
|
+
...src_default,
|
992
|
+
...opts
|
993
|
+
},
|
994
|
+
{ usePrettierrc: !opts }
|
995
|
+
]
|
996
|
+
}
|
997
|
+
};
|
981
998
|
}
|
982
999
|
|
983
|
-
|
984
|
-
|
985
|
-
var import_js = __toESM(require("@eslint/js"));
|
986
|
-
var import_eslint_plugin_mocha = __toESM(require("eslint-plugin-mocha"));
|
1000
|
+
//#endregion
|
1001
|
+
//#region src/configs/godaddy.ts
|
987
1002
|
function godaddy() {
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
"unicorn/prefer-string-replace-all": "off",
|
1023
|
-
"new-cap": "off"
|
1024
|
-
}
|
1025
|
-
};
|
1003
|
+
return {
|
1004
|
+
name: "agilebot/godaddy",
|
1005
|
+
files: require_constants.DEFAULT_GLOBS,
|
1006
|
+
languageOptions: { parserOptions: {
|
1007
|
+
ecmaVersion: 2022,
|
1008
|
+
sourceType: "module"
|
1009
|
+
} },
|
1010
|
+
plugins: { mocha: eslint_plugin_mocha.default },
|
1011
|
+
rules: {
|
1012
|
+
...__eslint_js.default.configs.recommended.rules,
|
1013
|
+
...eslint_config_godaddy.default.rules,
|
1014
|
+
"quote-props": "off",
|
1015
|
+
"linebreak-style": "off",
|
1016
|
+
complexity: "off",
|
1017
|
+
"max-statements": "off",
|
1018
|
+
"id-length": "off",
|
1019
|
+
"default-case": "off",
|
1020
|
+
"valid-jsdoc": "off",
|
1021
|
+
"generator-star-spacing": "off",
|
1022
|
+
"max-params": "off",
|
1023
|
+
"max-depth": "off",
|
1024
|
+
"max-len": "off",
|
1025
|
+
indent: "off",
|
1026
|
+
"no-undefined": "off",
|
1027
|
+
"no-process-env": "off",
|
1028
|
+
"no-sync": "off",
|
1029
|
+
"no-continue": "off",
|
1030
|
+
"no-case-declarations": "off",
|
1031
|
+
"callback-return": "off",
|
1032
|
+
"unicorn/prefer-string-slice": "off",
|
1033
|
+
"unicorn/prefer-string-replace-all": "off",
|
1034
|
+
"new-cap": "off"
|
1035
|
+
}
|
1036
|
+
};
|
1026
1037
|
}
|
1027
1038
|
|
1028
|
-
|
1039
|
+
//#endregion
|
1040
|
+
//#region src/factory/index.ts
|
1029
1041
|
function factory(root, options) {
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
version: options.vue
|
1134
|
-
})
|
1135
|
-
);
|
1136
|
-
}
|
1137
|
-
if (options.lodash) {
|
1138
|
-
config2.push(lodash());
|
1139
|
-
}
|
1140
|
-
if (options.cspell) {
|
1141
|
-
config2.push(cspell(options.cspell));
|
1142
|
-
}
|
1143
|
-
if (options.jsdoc) {
|
1144
|
-
config2.push({
|
1145
|
-
...jsdoc({
|
1146
|
-
ts: true
|
1147
|
-
}),
|
1148
|
-
files: TS_GLOBS
|
1149
|
-
});
|
1150
|
-
config2.push({
|
1151
|
-
...jsdoc({
|
1152
|
-
ts: false
|
1153
|
-
}),
|
1154
|
-
files: JS_GLOBS
|
1155
|
-
});
|
1156
|
-
}
|
1157
|
-
config2.push(...commonConfigs);
|
1158
|
-
config2.push(
|
1159
|
-
agilebot({
|
1160
|
-
root: rootDir,
|
1161
|
-
monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
|
1162
|
-
})
|
1163
|
-
);
|
1164
|
-
}
|
1165
|
-
if (options.config) {
|
1166
|
-
config2.push({
|
1167
|
-
name: "agilebot/custom",
|
1168
|
-
files: DEFAULT_GLOBS,
|
1169
|
-
...options.config
|
1170
|
-
});
|
1171
|
-
}
|
1172
|
-
config2.push({
|
1173
|
-
name: "agilebot/ignores",
|
1174
|
-
ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
|
1175
|
-
});
|
1176
|
-
const allPlugins = {};
|
1177
|
-
config2.forEach((configItem) => {
|
1178
|
-
if (configItem.plugins) {
|
1179
|
-
Object.assign(allPlugins, configItem.plugins);
|
1180
|
-
delete configItem.plugins;
|
1181
|
-
}
|
1182
|
-
});
|
1183
|
-
config2.unshift({
|
1184
|
-
name: "agilebot/plugins",
|
1185
|
-
files: DEFAULT_GLOBS,
|
1186
|
-
plugins: allPlugins
|
1187
|
-
});
|
1188
|
-
return config2;
|
1042
|
+
node_assert.default.ok(root, "root option is required");
|
1043
|
+
let rootDir;
|
1044
|
+
if (typeof root === "string") rootDir = root;
|
1045
|
+
else if (root?.url) rootDir = node_path.default.dirname((0, node_url.fileURLToPath)(root.url));
|
1046
|
+
else throw new Error("root must be a string or ImportMeta");
|
1047
|
+
const tsconfigFiles = (0, __agilebot_eslint_utils.findTsconfigFiles)(rootDir, { absolute: true });
|
1048
|
+
const defaultOptions = {
|
1049
|
+
jsdoc: true,
|
1050
|
+
prettier: true,
|
1051
|
+
lodash: true,
|
1052
|
+
cspell: {},
|
1053
|
+
import: true
|
1054
|
+
};
|
1055
|
+
options = {
|
1056
|
+
...defaultOptions,
|
1057
|
+
...options
|
1058
|
+
};
|
1059
|
+
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");
|
1060
|
+
const commonConfigs = [unicorn({ module: options.module ?? false }), comments()];
|
1061
|
+
if (options.import) commonConfigs.push(imports(rootDir, typeof options.import === "object" ? options.import : {}));
|
1062
|
+
if (options.prettier) commonConfigs.push(prettier(typeof options.prettier === "object" ? options.prettier : void 0));
|
1063
|
+
const config$1 = [];
|
1064
|
+
if (options.godaddy) {
|
1065
|
+
config$1.push({
|
1066
|
+
name: "agilebot/parser",
|
1067
|
+
files: require_constants.DEFAULT_GLOBS,
|
1068
|
+
languageOptions: {
|
1069
|
+
parser: options.godaddy === "typescript" ? __typescript_eslint_parser : void 0,
|
1070
|
+
parserOptions: { project: tsconfigFiles.length > 0 ? tsconfigFiles : true }
|
1071
|
+
}
|
1072
|
+
});
|
1073
|
+
config$1.push(env());
|
1074
|
+
if (options.jsdoc) config$1.push(jsdoc({ ts: false }));
|
1075
|
+
config$1.push(...commonConfigs);
|
1076
|
+
config$1.push(godaddy());
|
1077
|
+
} else {
|
1078
|
+
config$1.push({
|
1079
|
+
name: "agilebot/parser",
|
1080
|
+
files: require_constants.DEFAULT_GLOBS,
|
1081
|
+
languageOptions: {
|
1082
|
+
parser: !options.vue ? __typescript_eslint_parser : vue_eslint_parser,
|
1083
|
+
parserOptions: {
|
1084
|
+
parser: __typescript_eslint_parser,
|
1085
|
+
tsconfigRootDir: root,
|
1086
|
+
projectService: true,
|
1087
|
+
project: tsconfigFiles.length > 0 ? tsconfigFiles : true,
|
1088
|
+
ecmaFeatures: { jsx: true },
|
1089
|
+
sourceType: options.module ? "module" : void 0,
|
1090
|
+
extraFileExtensions: !options.vue ? void 0 : [".vue"]
|
1091
|
+
}
|
1092
|
+
}
|
1093
|
+
});
|
1094
|
+
config$1.push(env());
|
1095
|
+
config$1.push(standard());
|
1096
|
+
config$1.push(ts());
|
1097
|
+
config$1.push(jsOnly());
|
1098
|
+
config$1.push(dts());
|
1099
|
+
config$1.push(tsOnly());
|
1100
|
+
if (options.react) {
|
1101
|
+
config$1.push(react({ version: options.react }));
|
1102
|
+
config$1.push(reactJsOnly());
|
1103
|
+
}
|
1104
|
+
if (options.vue) config$1.push(vue({ version: options.vue }));
|
1105
|
+
if (options.lodash) config$1.push(lodash());
|
1106
|
+
if (options.cspell) config$1.push(cspell(options.cspell));
|
1107
|
+
if (options.jsdoc) {
|
1108
|
+
config$1.push({
|
1109
|
+
...jsdoc({ ts: true }),
|
1110
|
+
files: require_constants.TS_GLOBS
|
1111
|
+
});
|
1112
|
+
config$1.push({
|
1113
|
+
...jsdoc({ ts: false }),
|
1114
|
+
files: require_constants.JS_GLOBS
|
1115
|
+
});
|
1116
|
+
}
|
1117
|
+
config$1.push(...commonConfigs);
|
1118
|
+
config$1.push(agilebot({
|
1119
|
+
root: rootDir,
|
1120
|
+
monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
|
1121
|
+
}));
|
1122
|
+
}
|
1123
|
+
if (options.config) config$1.push({
|
1124
|
+
name: "agilebot/custom",
|
1125
|
+
files: require_constants.DEFAULT_GLOBS,
|
1126
|
+
...options.config
|
1127
|
+
});
|
1128
|
+
config$1.push({
|
1129
|
+
name: "agilebot/ignores",
|
1130
|
+
ignores: [...require_constants.IGNORE_GLOBS, ...options.ignores ?? []]
|
1131
|
+
});
|
1132
|
+
const allPlugins = {};
|
1133
|
+
config$1.forEach((configItem) => {
|
1134
|
+
if (configItem.plugins) {
|
1135
|
+
Object.assign(allPlugins, configItem.plugins);
|
1136
|
+
delete configItem.plugins;
|
1137
|
+
}
|
1138
|
+
});
|
1139
|
+
config$1.unshift({
|
1140
|
+
name: "agilebot/plugins",
|
1141
|
+
files: require_constants.DEFAULT_GLOBS,
|
1142
|
+
plugins: allPlugins
|
1143
|
+
});
|
1144
|
+
return config$1;
|
1189
1145
|
}
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
});
|
1194
|
-
/**
|
1195
|
-
* @license @agilebot/prettier-config v0.8.0
|
1196
|
-
*
|
1197
|
-
* Copyright (c) Agilebot, Inc. and its affiliates.
|
1198
|
-
*
|
1199
|
-
* This source code is licensed under the MIT license found in the
|
1200
|
-
* LICENSE file in the root directory of this source tree.
|
1201
|
-
*/
|
1146
|
+
|
1147
|
+
//#endregion
|
1148
|
+
exports.agilebot = factory;
|