@agilebot/eslint-config 0.4.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require('../dist/cli').cli();
2
+ require('../dist/cli');
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- declare function cli(): void;
2
1
 
3
- export { cli };
2
+ export { }
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.4.5
2
+ * @license @agilebot/eslint-config v0.5.1
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -14,10 +14,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
14
  var __getOwnPropNames = Object.getOwnPropertyNames;
15
15
  var __getProtoOf = Object.getPrototypeOf;
16
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
17
  var __copyProps = (to, from, except, desc) => {
22
18
  if (from && typeof from === "object" || typeof from === "function") {
23
19
  for (let key of __getOwnPropNames(from))
@@ -34,26 +30,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
30
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
31
  mod
36
32
  ));
37
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
-
39
- // src/cli.ts
40
- var cli_exports = {};
41
- __export(cli_exports, {
42
- cli: () => cli
43
- });
44
- module.exports = __toCommonJS(cli_exports);
45
33
 
46
34
  // src/cli/index.ts
47
- var import_node_fs = __toESM(require("fs"));
48
35
  var import_node_path = __toESM(require("path"));
49
36
  var import_eslint_utils = require("@agilebot/eslint-utils");
37
+ var import_yargs = __toESM(require("yargs"));
38
+ var import_helpers = require("yargs/helpers");
39
+ var import_picocolors = __toESM(require("picocolors"));
50
40
 
51
41
  // src/constants.ts
52
42
  var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
53
43
  var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
54
44
  var VUE_EXTS = [".vue"];
55
45
  var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
56
- var IS_ESLINT = /^\.eslint.*/;
57
46
 
58
47
  // src/cli/index.ts
59
48
  function patch() {
@@ -68,34 +57,62 @@ function patch() {
68
57
  }
69
58
  function cli() {
70
59
  patch();
71
- const cwd = process.cwd();
72
- const has = {
73
- ext: false,
74
- fix: false,
75
- config: false,
76
- strict: false,
77
- checkIntl: false,
78
- progress: false,
79
- showWarningsInCI: false
80
- };
60
+ const argv = (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName("eslint-agilebot").usage("eslint-agilebot [options] file.js [file.js] [dir]").options({
61
+ ext: {
62
+ type: "string",
63
+ description: "Specify file extensions",
64
+ default: DEFAULT_EXTS.join(",")
65
+ },
66
+ config: {
67
+ alias: "c",
68
+ type: "string",
69
+ description: "Use this configuration instead of .eslintrc.cjs, .eslintrc.js"
70
+ },
71
+ fix: {
72
+ type: "boolean",
73
+ description: "Automatically fix problems",
74
+ default: true
75
+ },
76
+ "check-intl": {
77
+ type: "boolean",
78
+ description: "Check for unused intl IDs",
79
+ default: false
80
+ },
81
+ progress: {
82
+ type: "boolean",
83
+ description: "Show progress bar",
84
+ default: false
85
+ },
86
+ "show-warnings-in-ci": {
87
+ type: "boolean",
88
+ description: "Show warnings in CI environment",
89
+ default: false
90
+ }
91
+ }).alias("h", "help").alias("v", "version").parseSync();
81
92
  const pkg = require.resolve("eslint/package.json");
82
93
  const bin = import_node_path.default.join(pkg, "..", "bin", "eslint.js");
83
- process.argv.forEach((arg) => {
84
- has.ext = has.ext || arg === "--ext";
85
- has.fix = has.fix || arg === "--fix";
86
- has.config = has.config || arg === "-c" || arg === "--config";
87
- has.strict = has.strict || arg === "--strict";
88
- has.checkIntl = has.checkIntl || arg === "--check-intl";
89
- has.progress = has.progress || arg === "--progress";
90
- has.showWarningsInCI = has.showWarningsInCI || arg === "--show-warnings-in-ci";
94
+ process.argv = process.argv.slice(0, 2);
95
+ if (argv._.length === 0) {
96
+ console.error(
97
+ import_picocolors.default.red(
98
+ "Error: 'patterns' must be a non-empty string or an array of non-empty strings"
99
+ )
100
+ );
101
+ process.exit(1);
102
+ }
103
+ argv._.forEach((pattern) => {
104
+ process.argv.push(String(pattern));
91
105
  });
92
- if (!has.fix) {
106
+ if (argv.fix) {
93
107
  process.argv.splice(2, 0, "--fix");
94
108
  }
95
- if (!has.ext) {
96
- process.argv.splice(2, 0, "--ext", DEFAULT_EXTS.join(","));
109
+ if (argv.ext) {
110
+ process.argv.splice(2, 0, "--ext", argv.ext);
97
111
  }
98
- if (has.progress && !(0, import_eslint_utils.isCI)()) {
112
+ if (argv.config) {
113
+ process.argv.splice(2, 0, "--config", argv.config);
114
+ }
115
+ if (argv.progress && !(0, import_eslint_utils.isCI)()) {
99
116
  process.argv.splice(
100
117
  2,
101
118
  0,
@@ -105,31 +122,20 @@ function cli() {
105
122
  "file-progress/activate: 1"
106
123
  );
107
124
  }
108
- if (!has.showWarningsInCI && (0, import_eslint_utils.isCI)()) {
125
+ if (!argv.showWarningsInCi && (0, import_eslint_utils.isCI)()) {
109
126
  console.warn(
110
- "Warning: eslint-agilebot will report errors only in CI environment"
127
+ import_picocolors.default.yellow(
128
+ "Warning: eslint-agilebot will report errors only in CI environment"
129
+ )
111
130
  );
112
131
  process.argv.splice(2, 0, "--quiet");
113
132
  }
114
- if (has.checkIntl) {
115
- process.argv.splice(process.argv.indexOf("--check-intl"), 1);
133
+ if (argv.checkIntl) {
116
134
  process.argv.splice(2, 0, "--rule", "@agilebot/intl-id-unused: 1");
117
135
  }
118
- import_node_fs.default.readdir(cwd, (err, files) => {
119
- if (err) {
120
- throw err;
121
- }
122
- has.config = has.config || files.some((file) => {
123
- return IS_ESLINT.test(file);
124
- });
125
- if (has.strict && !has.config) {
126
- throw new Error("No ESLint configuration file found");
127
- }
128
- require(bin);
129
- });
136
+ require(bin);
130
137
  }
131
- // Annotate the CommonJS export names for ESM import in node:
132
- 0 && (module.exports = {
133
- cli
134
- });
138
+
139
+ // src/cli.ts
140
+ cli();
135
141
  if (module.exports.default) module.exports = module.exports.default;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.4.5
2
+ * @license @agilebot/eslint-config v0.5.1
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -85,7 +85,7 @@ function standard() {
85
85
  // @ts-expect-error -- extracted rules from eslint-config-love
86
86
  false ? {} : (
87
87
  // @ts-expect-error -- extracted rules from eslint-config-love
88
- JSON.parse('{"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-redeclare":["off"],"no-unused-expressions":["off"],"no-unused-vars":["off"],"no-use-before-define":["off"],"no-useless-constructor":["off"],"prefer-promise-reject-errors":["off"],"@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-methods-use-this":["error",{"exceptMethods":[],"enforceForClassFields":true,"ignoreOverrideMethods":false,"ignoreClassesThatImplementAnInterface":false}],"@typescript-eslint/class-literal-property-style":["error","fields"],"@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-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-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-empty-object-type":["error",{"allowInterfaces":"with-single-extends","allowObjectTypes":"never"}],"@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-misused-new":["error"],"@typescript-eslint/no-misused-promises":["error"],"@typescript-eslint/no-namespace":["error"],"@typescript-eslint/no-non-null-asserted-optional-chain":["error"],"@typescript-eslint/no-non-null-assertion":["error"],"@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@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-type-assertion":["error"],"@typescript-eslint/no-unnecessary-type-constraint":["error"],"@typescript-eslint/no-unsafe-argument":["error"],"@typescript-eslint/no-unsafe-function-type":["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-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-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}],"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-symbol":["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-undef-init":["error"],"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"]}')
88
+ JSON.parse('{"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-redeclare":["off"],"no-unused-expressions":["off"],"no-unused-vars":["off"],"no-use-before-define":["off"],"no-useless-constructor":["off"],"prefer-promise-reject-errors":["off"],"@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-methods-use-this":["error",{"exceptMethods":[],"enforceForClassFields":true,"ignoreOverrideMethods":false,"ignoreClassesThatImplementAnInterface":false}],"@typescript-eslint/class-literal-property-style":["error","fields"],"@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-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-empty-object-type":["error",{"allowInterfaces":"with-single-extends","allowObjectTypes":"never"}],"@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":true,"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-namespace":["error"],"@typescript-eslint/no-non-null-asserted-optional-chain":["error"],"@typescript-eslint/no-non-null-assertion":["error"],"@typescript-eslint/no-redeclare":["error",{"builtinGlobals":false}],"@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-type-assertion":["error"],"@typescript-eslint/no-unnecessary-type-constraint":["error"],"@typescript-eslint/no-unsafe-argument":["error"],"@typescript-eslint/no-unsafe-function-type":["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-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-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}],"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-symbol":["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-undef-init":["error"],"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"]}')
89
89
  )
90
90
  );
91
91
  Object.entries(originalStdRules).forEach(([key, value]) => {
@@ -155,7 +155,11 @@ function standardDisabled() {
155
155
  "@typescript-eslint/no-explicit-any": "off",
156
156
  // v57.0.0
157
157
  "@typescript-eslint/init-declarations": "off",
158
- "@typescript-eslint/no-empty-function": "off"
158
+ "@typescript-eslint/no-empty-function": "off",
159
+ // v64.0.0
160
+ "@typescript-eslint/no-deprecated": "off",
161
+ // v65.0.0
162
+ "@typescript-eslint/no-magic-numbers": "off"
159
163
  }
160
164
  };
161
165
  }
@@ -517,6 +521,7 @@ function react(opts) {
517
521
  "@eslint-react/web-api/no-leaked-interval": "warn",
518
522
  "@eslint-react/web-api/no-leaked-timeout": "warn",
519
523
  "@eslint-react/web-api/no-leaked-event-listener": "warn",
524
+ "@eslint-react/web-api/no-leaked-resize-observer": "warn",
520
525
  // 以下是自定义规则
521
526
  "react/jsx-handler-names": [
522
527
  "error",
@@ -604,7 +609,10 @@ function jsdoc(opt) {
604
609
  function lodash() {
605
610
  return {
606
611
  // lodash一些方法可能影响性能,如forEach等,优先使用js的原生方法
607
- extends: ["plugin:you-dont-need-lodash-underscore/compatible"]
612
+ extends: ["plugin:you-dont-need-lodash-underscore/compatible"],
613
+ rules: {
614
+ "you-dont-need-lodash-underscore/throttle": "off"
615
+ }
608
616
  };
609
617
  }
610
618
 
@@ -742,7 +750,8 @@ function godaddy() {
742
750
  "no-case-declarations": "off",
743
751
  "callback-return": "off",
744
752
  "unicorn/prefer-string-slice": "off",
745
- "unicorn/prefer-string-replace-all": "off"
753
+ "unicorn/prefer-string-replace-all": "off",
754
+ "new-cap": "off"
746
755
  }
747
756
  };
748
757
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.4.5",
3
+ "version": "0.5.1",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "bin": {
6
6
  "eslint-agilebot": "bin/eslint-agilebot"
@@ -27,10 +27,10 @@
27
27
  "eslint-config-godaddy": "^6.0.0",
28
28
  "eslint-config-prettier": "^9.1.0",
29
29
  "eslint-import-resolver-oxc": "^0.3.0",
30
- "eslint-import-resolver-typescript": "^3.6.1",
30
+ "eslint-import-resolver-typescript": "^3.6.3",
31
31
  "eslint-plugin-file-progress": "^1.5.0",
32
32
  "eslint-plugin-import-x": "^4.0.0",
33
- "eslint-plugin-jsdoc": "^50.2.2",
33
+ "eslint-plugin-jsdoc": "^50.2.3",
34
34
  "eslint-plugin-jsx-a11y": "^6.9.0",
35
35
  "eslint-plugin-n": "^17.10.2",
36
36
  "eslint-plugin-no-relative-import-paths": "^1.5.5",
@@ -39,18 +39,21 @@
39
39
  "eslint-plugin-promise": "^7.1.0",
40
40
  "eslint-plugin-react": "^7.35.0",
41
41
  "eslint-plugin-unicorn": "^55.0.0",
42
- "eslint-plugin-unused-imports": "^4.1.3",
43
- "eslint-plugin-vue": "^9.27.0",
42
+ "eslint-plugin-unused-imports": "^4.1.4",
43
+ "eslint-plugin-vue": "^9.28.0",
44
44
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
45
+ "picocolors": "^1.1.0",
45
46
  "vue-eslint-parser": "^9.4.3",
46
- "@agilebot/eslint-utils": "0.4.5"
47
+ "yargs": "^17.7.2",
48
+ "@agilebot/eslint-utils": "0.5.1"
47
49
  },
48
50
  "devDependencies": {
49
- "eslint-config-love": "^63.0.0"
51
+ "@types/yargs": "^17.0.33",
52
+ "eslint-config-love": "^66.0.0"
50
53
  },
51
54
  "peerDependencies": {
52
55
  "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
53
- "@agilebot/eslint-plugin": "0.4.5"
56
+ "@agilebot/eslint-plugin": "0.5.1"
54
57
  },
55
58
  "files": [
56
59
  "bin",
@@ -58,6 +61,7 @@
58
61
  ],
59
62
  "scripts": {
60
63
  "build": "tsup",
64
+ "dev:cli": "tsx src/cli.ts",
61
65
  "lint": "eslint-agilebot src"
62
66
  }
63
67
  }