@agilebot/eslint-config 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/dist/cli.js +14 -9
- package/dist/index.js +52 -50
- package/package.json +12 -11
package/README.md
CHANGED
package/dist/cli.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.5.
|
2
|
+
* @license @agilebot/eslint-config v0.5.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -32,7 +32,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
32
32
|
));
|
33
33
|
|
34
34
|
// src/cli/index.ts
|
35
|
-
var import_node_path = __toESM(require("path"));
|
36
35
|
var import_eslint_utils = require("@agilebot/eslint-utils");
|
37
36
|
var import_yargs = __toESM(require("yargs"));
|
38
37
|
var import_helpers = require("yargs/helpers");
|
@@ -43,8 +42,10 @@ var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
|
|
43
42
|
var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
|
44
43
|
var VUE_EXTS = [".vue"];
|
45
44
|
var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
|
45
|
+
var CLI_NAME = "eslint-agilebot";
|
46
46
|
|
47
|
-
// src/cli/
|
47
|
+
// src/cli/stages/eslint.ts
|
48
|
+
var import_node_path = __toESM(require("path"));
|
48
49
|
function patch() {
|
49
50
|
process.env.ESLINT_USE_FLAT_CONFIG = "false";
|
50
51
|
const oldEmitWarning = process.emitWarning;
|
@@ -55,9 +56,16 @@ function patch() {
|
|
55
56
|
oldEmitWarning(warning, ...args);
|
56
57
|
};
|
57
58
|
}
|
59
|
+
function runBinary() {
|
60
|
+
const pkg = require.resolve("eslint/package.json");
|
61
|
+
const bin = import_node_path.default.join(pkg, "..", "bin", "eslint.js");
|
62
|
+
require(bin);
|
63
|
+
}
|
64
|
+
|
65
|
+
// src/cli/index.ts
|
58
66
|
function cli() {
|
59
67
|
patch();
|
60
|
-
const argv = (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName(
|
68
|
+
const argv = (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName(CLI_NAME).usage(`${CLI_NAME} [options] file.js [file.js] [dir]`).options({
|
61
69
|
ext: {
|
62
70
|
type: "string",
|
63
71
|
description: "Specify file extensions",
|
@@ -89,8 +97,6 @@ function cli() {
|
|
89
97
|
default: false
|
90
98
|
}
|
91
99
|
}).alias("h", "help").alias("v", "version").parseSync();
|
92
|
-
const pkg = require.resolve("eslint/package.json");
|
93
|
-
const bin = import_node_path.default.join(pkg, "..", "bin", "eslint.js");
|
94
100
|
process.argv = process.argv.slice(0, 2);
|
95
101
|
if (argv._.length === 0) {
|
96
102
|
console.error(
|
@@ -125,7 +131,7 @@ function cli() {
|
|
125
131
|
if (!argv.showWarningsInCi && (0, import_eslint_utils.isCI)()) {
|
126
132
|
console.warn(
|
127
133
|
import_picocolors.default.yellow(
|
128
|
-
|
134
|
+
`Warning: ${CLI_NAME} will report errors only in CI environment`
|
129
135
|
)
|
130
136
|
);
|
131
137
|
process.argv.splice(2, 0, "--quiet");
|
@@ -133,9 +139,8 @@ function cli() {
|
|
133
139
|
if (argv.checkIntl) {
|
134
140
|
process.argv.splice(2, 0, "--rule", "@agilebot/intl-id-unused: 1");
|
135
141
|
}
|
136
|
-
|
142
|
+
runBinary();
|
137
143
|
}
|
138
144
|
|
139
145
|
// src/cli.ts
|
140
146
|
cli();
|
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.5.
|
2
|
+
* @license @agilebot/eslint-config v0.5.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -60,6 +60,9 @@ __export(src_exports, {
|
|
60
60
|
});
|
61
61
|
module.exports = __toCommonJS(src_exports);
|
62
62
|
|
63
|
+
// <define:__STANDARD_RULES>
|
64
|
+
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 }] };
|
65
|
+
|
63
66
|
// src/factory/index.ts
|
64
67
|
var import_node_assert = __toESM(require("assert"));
|
65
68
|
var import_eslint_utils3 = require("@agilebot/eslint-utils");
|
@@ -83,22 +86,25 @@ function standard() {
|
|
83
86
|
const standardRules = {};
|
84
87
|
const originalStdRules = (
|
85
88
|
// @ts-expect-error -- extracted rules from eslint-config-love
|
86
|
-
|
89
|
+
typeof define_STANDARD_RULES_default === "undefined" ? {} : (
|
87
90
|
// @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-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"]}')
|
91
|
+
define_STANDARD_RULES_default
|
89
92
|
)
|
90
93
|
);
|
94
|
+
const disabledRules = new Set(Object.values(standardDisabled()).flat());
|
91
95
|
Object.entries(originalStdRules).forEach(([key, value]) => {
|
96
|
+
if (disabledRules.has(key)) {
|
97
|
+
return;
|
98
|
+
}
|
92
99
|
if (key.startsWith("import/")) {
|
93
100
|
standardRules[`import-x/${key.slice(7)}`] = value;
|
94
101
|
} else {
|
95
102
|
standardRules[key] = value;
|
96
103
|
}
|
97
104
|
});
|
98
|
-
const disabled = standardDisabled();
|
99
105
|
return {
|
100
106
|
plugins: ["@typescript-eslint", "import-x", "n", "promise"],
|
101
|
-
rules:
|
107
|
+
rules: __spreadProps(__spreadValues({}, standardRules), {
|
102
108
|
"no-alert": "error",
|
103
109
|
// 找出TODO注释,以便后期修复
|
104
110
|
"no-warning-comments": [
|
@@ -133,34 +139,46 @@ function standard() {
|
|
133
139
|
}
|
134
140
|
],
|
135
141
|
"@typescript-eslint/no-loop-func": "warn"
|
136
|
-
})
|
142
|
+
})
|
137
143
|
};
|
138
144
|
}
|
139
145
|
function standardDisabled() {
|
140
146
|
return {
|
141
|
-
|
142
|
-
"@typescript-eslint/no-
|
143
|
-
"@typescript-eslint/
|
144
|
-
"@typescript-eslint/
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
"@typescript-eslint/
|
150
|
-
"@typescript-eslint/
|
151
|
-
|
152
|
-
|
153
|
-
"@typescript-eslint/
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
"@typescript-eslint/no-
|
163
|
-
|
147
|
+
uncategoized: [
|
148
|
+
"@typescript-eslint/no-extraneous-class",
|
149
|
+
"@typescript-eslint/consistent-type-assertions",
|
150
|
+
"@typescript-eslint/no-non-null-assertion"
|
151
|
+
],
|
152
|
+
"v9.0.0": ["@typescript-eslint/strict-boolean-expressions"],
|
153
|
+
"v10.0.0": ["@typescript-eslint/explicit-function-return-type"],
|
154
|
+
"v12.0.0": [
|
155
|
+
"@typescript-eslint/restrict-template-expressions",
|
156
|
+
"@typescript-eslint/space-before-function-paren"
|
157
|
+
],
|
158
|
+
"v17.0.0": [
|
159
|
+
"@typescript-eslint/no-invalid-void-type",
|
160
|
+
"@typescript-eslint/method-signature-style"
|
161
|
+
],
|
162
|
+
"v26.0.0": ["@typescript-eslint/no-confusing-void-expression"],
|
163
|
+
"v40.0.0": ["@typescript-eslint/unbound-method"],
|
164
|
+
"v42.0.0": ["@typescript-eslint/no-unsafe-argument"],
|
165
|
+
"v55.0.0": ["@typescript-eslint/class-methods-use-this"],
|
166
|
+
"v57.0.0": [
|
167
|
+
"@typescript-eslint/init-declarations",
|
168
|
+
"@typescript-eslint/no-empty-function"
|
169
|
+
],
|
170
|
+
"v58.0.0": ["@typescript-eslint/no-explicit-any"],
|
171
|
+
"v64.0.0": ["@typescript-eslint/no-deprecated"],
|
172
|
+
"v65.0.0": ["@typescript-eslint/no-magic-numbers"],
|
173
|
+
"v70.0.0": ["@typescript-eslint/no-unnecessary-condition"],
|
174
|
+
"v75.0.0": ["@typescript-eslint/no-unnecessary-type-parameters"],
|
175
|
+
"v76.0.0": ["@typescript-eslint/no-unsafe-assignment"],
|
176
|
+
"v77.0.0": ["@typescript-eslint/no-unsafe-call"],
|
177
|
+
"v79.0.0": ["@typescript-eslint/no-unsafe-enum-comparison"],
|
178
|
+
"v80.0.0": ["@typescript-eslint/no-unsafe-member-access"],
|
179
|
+
"v81.0.0": ["@typescript-eslint/no-unsafe-return"],
|
180
|
+
"v82.0.0": ["@typescript-eslint/no-unsafe-unary-minus"],
|
181
|
+
"v89.0.0": ["@typescript-eslint/prefer-destructuring"]
|
164
182
|
};
|
165
183
|
}
|
166
184
|
|
@@ -502,7 +520,10 @@ function react(opts) {
|
|
502
520
|
"@eslint-react/prefer-shorthand-fragment": "error",
|
503
521
|
"@eslint-react/no-missing-component-display-name": "error",
|
504
522
|
"@eslint-react/no-prop-types": "error",
|
505
|
-
"@eslint-react/no-useless-fragment":
|
523
|
+
"@eslint-react/no-useless-fragment": [
|
524
|
+
"error",
|
525
|
+
{ allowExpressions: true }
|
526
|
+
],
|
506
527
|
// recommended rules from @eslint-react/dom
|
507
528
|
"@eslint-react/dom/no-children-in-void-dom-elements": "error",
|
508
529
|
"@eslint-react/dom/no-unsafe-target-blank": "error",
|
@@ -677,25 +698,7 @@ function agilebot(opts) {
|
|
677
698
|
plugins: ["react-hooks"],
|
678
699
|
rules: {
|
679
700
|
"react-hooks/exhaustive-deps": "off",
|
680
|
-
"@agilebot/react-better-exhaustive-deps":
|
681
|
-
"warn",
|
682
|
-
{
|
683
|
-
checkMemoizedVariableIsStatic: true,
|
684
|
-
staticHooks: {
|
685
|
-
"useIpc.*": {
|
686
|
-
value: true,
|
687
|
-
regexp: true
|
688
|
-
},
|
689
|
-
useDialog: true,
|
690
|
-
useSnackbar: true,
|
691
|
-
useForm: true,
|
692
|
-
"use.*Store": {
|
693
|
-
value: true,
|
694
|
-
regexp: true
|
695
|
-
}
|
696
|
-
}
|
697
|
-
}
|
698
|
-
]
|
701
|
+
"@agilebot/react-better-exhaustive-deps": "warn"
|
699
702
|
},
|
700
703
|
settings: {
|
701
704
|
"agilebot/project-root": opts.root,
|
@@ -886,4 +889,3 @@ function factory(root, options) {
|
|
886
889
|
0 && (module.exports = {
|
887
890
|
agilebot
|
888
891
|
});
|
889
|
-
if (module.exports.default) module.exports = module.exports.default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.3",
|
4
4
|
"description": "Agilebot's ESLint config",
|
5
5
|
"bin": {
|
6
6
|
"eslint-agilebot": "bin/eslint-agilebot"
|
@@ -18,21 +18,21 @@
|
|
18
18
|
},
|
19
19
|
"homepage": "https://github.com/sh-agilebot/frontend-toolkit/tree/master/packages/eslint-config#readme",
|
20
20
|
"dependencies": {
|
21
|
-
"@cspell/eslint-plugin": "^8.14.
|
21
|
+
"@cspell/eslint-plugin": "^8.14.4",
|
22
22
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
23
|
-
"@eslint-react/eslint-plugin": "^1.
|
23
|
+
"@eslint-react/eslint-plugin": "^1.15.0",
|
24
24
|
"@stylistic/eslint-plugin": "^2.8.0",
|
25
|
-
"@typescript-eslint/eslint-plugin": "~8.
|
26
|
-
"@typescript-eslint/parser": "~8.
|
25
|
+
"@typescript-eslint/eslint-plugin": "~8.7.0",
|
26
|
+
"@typescript-eslint/parser": "~8.7.0",
|
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
30
|
"eslint-import-resolver-typescript": "^3.6.3",
|
31
31
|
"eslint-plugin-file-progress": "^1.5.0",
|
32
|
-
"eslint-plugin-import-x": "^4.
|
33
|
-
"eslint-plugin-jsdoc": "^50.
|
32
|
+
"eslint-plugin-import-x": "^4.3.0",
|
33
|
+
"eslint-plugin-jsdoc": "^50.3.0",
|
34
34
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
35
|
-
"eslint-plugin-n": "^17.10.
|
35
|
+
"eslint-plugin-n": "^17.10.3",
|
36
36
|
"eslint-plugin-no-relative-import-paths": "^1.5.5",
|
37
37
|
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
|
38
38
|
"eslint-plugin-prettier": "^5.2.1",
|
@@ -42,18 +42,19 @@
|
|
42
42
|
"eslint-plugin-unused-imports": "^4.1.4",
|
43
43
|
"eslint-plugin-vue": "^9.28.0",
|
44
44
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
|
45
|
+
"find-up": "^5.0.0",
|
45
46
|
"picocolors": "^1.1.0",
|
46
47
|
"vue-eslint-parser": "^9.4.3",
|
47
48
|
"yargs": "^17.7.2",
|
48
|
-
"@agilebot/eslint-utils": "0.5.
|
49
|
+
"@agilebot/eslint-utils": "0.5.3"
|
49
50
|
},
|
50
51
|
"devDependencies": {
|
51
52
|
"@types/yargs": "^17.0.33",
|
52
|
-
"eslint-config-love": "^
|
53
|
+
"eslint-config-love": "^89.0.1"
|
53
54
|
},
|
54
55
|
"peerDependencies": {
|
55
56
|
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
56
|
-
"@agilebot/eslint-plugin": "0.5.
|
57
|
+
"@agilebot/eslint-plugin": "0.5.3"
|
57
58
|
},
|
58
59
|
"files": [
|
59
60
|
"bin",
|