@typescript-eslint/eslint-plugin 8.67.1-alpha.8 → 8.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5906 -0
- package/dist/configs/eslint-recommended-raw.js +1 -0
- package/dist/configs/eslintrc/all.js +1 -0
- package/dist/configs/eslintrc/base.js +1 -0
- package/dist/configs/eslintrc/disable-type-checked.js +1 -0
- package/dist/configs/eslintrc/eslint-recommended.js +1 -0
- package/dist/configs/eslintrc/recommended-type-checked-only.js +1 -0
- package/dist/configs/eslintrc/recommended-type-checked.js +1 -0
- package/dist/configs/eslintrc/recommended.js +1 -0
- package/dist/configs/eslintrc/strict-type-checked-only.js +1 -0
- package/dist/configs/eslintrc/strict-type-checked.js +1 -0
- package/dist/configs/eslintrc/strict.js +1 -0
- package/dist/configs/eslintrc/stylistic-type-checked-only.js +1 -0
- package/dist/configs/eslintrc/stylistic-type-checked.js +1 -0
- package/dist/configs/eslintrc/stylistic.js +1 -0
- package/dist/configs/flat/all.js +1 -0
- package/dist/configs/flat/base.js +1 -0
- package/dist/configs/flat/disable-type-checked.js +1 -0
- package/dist/configs/flat/eslint-recommended.js +1 -0
- package/dist/configs/flat/recommended-type-checked-only.js +1 -0
- package/dist/configs/flat/recommended-type-checked.js +1 -0
- package/dist/configs/flat/recommended.js +1 -0
- package/dist/configs/flat/strict-type-checked-only.js +1 -0
- package/dist/configs/flat/strict-type-checked.js +1 -0
- package/dist/configs/flat/strict.js +1 -0
- package/dist/configs/flat/stylistic-type-checked-only.js +1 -0
- package/dist/configs/flat/stylistic-type-checked.js +1 -0
- package/dist/configs/flat/stylistic.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/raw-plugin.d.ts +1 -1
- package/dist/raw-plugin.js +1 -0
- package/dist/rules/adjacent-overload-signatures.js +1 -0
- package/dist/rules/array-type.js +1 -0
- package/dist/rules/await-thenable.js +1 -0
- package/dist/rules/ban-ts-comment.js +1 -0
- package/dist/rules/ban-tslint-comment.js +1 -0
- package/dist/rules/class-literal-property-style.js +1 -0
- package/dist/rules/class-methods-use-this.js +1 -0
- package/dist/rules/consistent-generic-constructors.js +1 -0
- package/dist/rules/consistent-indexed-object-style.js +1 -0
- package/dist/rules/consistent-return.js +1 -0
- package/dist/rules/consistent-type-assertions.js +1 -0
- package/dist/rules/consistent-type-definitions.js +1 -0
- package/dist/rules/consistent-type-exports.js +1 -0
- package/dist/rules/consistent-type-imports.js +1 -0
- package/dist/rules/default-param-last.js +1 -0
- package/dist/rules/dot-notation.js +1 -0
- package/dist/rules/enum-utils/shared.d.ts +5 -0
- package/dist/rules/enum-utils/shared.js +68 -0
- package/dist/rules/explicit-function-return-type.js +1 -0
- package/dist/rules/explicit-member-accessibility.js +1 -0
- package/dist/rules/explicit-module-boundary-types.js +1 -0
- package/dist/rules/index.d.ts +1 -1
- package/dist/rules/index.js +1 -0
- package/dist/rules/init-declarations.js +1 -0
- package/dist/rules/max-params.js +1 -0
- package/dist/rules/member-ordering.js +1 -0
- package/dist/rules/method-signature-style.js +1 -0
- package/dist/rules/naming-convention-utils/enums.js +1 -0
- package/dist/rules/naming-convention-utils/format.js +1 -0
- package/dist/rules/naming-convention-utils/index.js +1 -0
- package/dist/rules/naming-convention-utils/parse-options.js +1 -0
- package/dist/rules/naming-convention-utils/schema.js +1 -0
- package/dist/rules/naming-convention-utils/shared.js +1 -0
- package/dist/rules/naming-convention-utils/types.js +1 -0
- package/dist/rules/naming-convention-utils/validator.js +1 -0
- package/dist/rules/naming-convention.js +1 -0
- package/dist/rules/no-array-constructor.js +1 -0
- package/dist/rules/no-array-delete.js +1 -0
- package/dist/rules/no-base-to-string.js +1 -0
- package/dist/rules/no-confusing-non-null-assertion.js +1 -0
- package/dist/rules/no-confusing-void-expression.js +8 -9
- package/dist/rules/no-deprecated.js +1 -0
- package/dist/rules/no-dupe-class-members.js +1 -0
- package/dist/rules/no-duplicate-enum-values.js +1 -0
- package/dist/rules/no-duplicate-type-constituents.js +1 -0
- package/dist/rules/no-dynamic-delete.js +1 -0
- package/dist/rules/no-empty-function.js +1 -0
- package/dist/rules/no-empty-interface.js +1 -0
- package/dist/rules/no-empty-object-type.js +9 -4
- package/dist/rules/no-explicit-any.js +1 -0
- package/dist/rules/no-extra-non-null-assertion.js +1 -0
- package/dist/rules/no-extraneous-class.js +1 -0
- package/dist/rules/no-floating-promises.js +64 -55
- package/dist/rules/no-for-in-array.js +1 -0
- package/dist/rules/no-implied-eval.js +1 -0
- package/dist/rules/no-import-type-side-effects.js +1 -0
- package/dist/rules/no-inferrable-types.js +1 -0
- package/dist/rules/no-invalid-this.js +1 -0
- package/dist/rules/no-invalid-void-type.js +1 -0
- package/dist/rules/no-loop-func.js +1 -0
- package/dist/rules/no-loss-of-precision.js +1 -0
- package/dist/rules/no-magic-numbers.js +1 -0
- package/dist/rules/no-meaningless-void-operator.js +1 -0
- package/dist/rules/no-misused-new.js +1 -0
- package/dist/rules/no-misused-promises.js +1 -0
- package/dist/rules/no-misused-spread.js +1 -0
- package/dist/rules/no-mixed-enums.js +1 -0
- package/dist/rules/no-namespace.js +1 -0
- package/dist/rules/no-non-null-asserted-nullish-coalescing.js +1 -0
- package/dist/rules/no-non-null-asserted-optional-chain.js +1 -0
- package/dist/rules/no-non-null-assertion.js +1 -0
- package/dist/rules/no-redeclare.js +1 -0
- package/dist/rules/no-redundant-type-constituents.js +1 -0
- package/dist/rules/no-require-imports.js +1 -0
- package/dist/rules/no-restricted-imports.js +1 -0
- package/dist/rules/no-restricted-types.js +1 -0
- package/dist/rules/no-shadow.js +1 -0
- package/dist/rules/no-this-alias.js +1 -0
- package/dist/rules/no-type-alias.js +1 -0
- package/dist/rules/no-unnecessary-boolean-literal-compare.js +1 -0
- package/dist/rules/no-unnecessary-condition.js +1 -0
- package/dist/rules/no-unnecessary-parameter-property-assignment.js +1 -0
- package/dist/rules/no-unnecessary-qualifier.js +1 -0
- package/dist/rules/no-unnecessary-template-expression.js +3 -14
- package/dist/rules/no-unnecessary-type-arguments.js +1 -0
- package/dist/rules/no-unnecessary-type-assertion.js +12 -1
- package/dist/rules/no-unnecessary-type-constraint.js +1 -0
- package/dist/rules/no-unnecessary-type-conversion.js +1 -0
- package/dist/rules/no-unnecessary-type-parameters.js +1 -0
- package/dist/rules/no-unsafe-argument.js +2 -91
- package/dist/rules/no-unsafe-assignment.js +1 -0
- package/dist/rules/no-unsafe-call.js +1 -0
- package/dist/rules/no-unsafe-declaration-merging.js +1 -0
- package/dist/rules/no-unsafe-enum-comparison.js +3 -113
- package/dist/rules/no-unsafe-function-type.js +1 -0
- package/dist/rules/no-unsafe-member-access.js +1 -0
- package/dist/rules/no-unsafe-return.js +1 -0
- package/dist/rules/no-unsafe-type-assertion.js +1 -0
- package/dist/rules/no-unsafe-unary-minus.js +1 -0
- package/dist/rules/no-unused-expressions.js +1 -0
- package/dist/rules/no-unused-private-class-members.js +1 -0
- package/dist/rules/no-unused-vars.js +1 -0
- package/dist/rules/no-use-before-define.js +1 -0
- package/dist/rules/no-useless-constructor.js +1 -0
- package/dist/rules/no-useless-default-assignment.js +1 -0
- package/dist/rules/no-useless-empty-export.js +1 -0
- package/dist/rules/no-var-requires.js +1 -0
- package/dist/rules/no-wrapper-object-types.js +1 -0
- package/dist/rules/non-nullable-type-assertion-style.js +1 -0
- package/dist/rules/only-throw-error.js +1 -0
- package/dist/rules/parameter-properties.js +1 -0
- package/dist/rules/prefer-as-const.js +1 -0
- package/dist/rules/prefer-destructuring.js +1 -0
- package/dist/rules/prefer-enum-initializers.js +1 -0
- package/dist/rules/prefer-find.js +1 -0
- package/dist/rules/prefer-for-of.js +1 -0
- package/dist/rules/prefer-function-type.js +1 -0
- package/dist/rules/prefer-includes.js +1 -0
- package/dist/rules/prefer-literal-enum-member.js +1 -0
- package/dist/rules/prefer-namespace-keyword.js +1 -0
- package/dist/rules/prefer-nullish-coalescing.js +1 -0
- package/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js +1 -0
- package/dist/rules/prefer-optional-chain-utils/analyzeChain.js +1 -0
- package/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js +1 -0
- package/dist/rules/prefer-optional-chain-utils/compareNodes.js +1 -0
- package/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js +1 -0
- package/dist/rules/prefer-optional-chain.js +1 -0
- package/dist/rules/prefer-promise-reject-errors.js +1 -0
- package/dist/rules/prefer-readonly-parameter-types.js +1 -0
- package/dist/rules/prefer-readonly.js +1 -0
- package/dist/rules/prefer-reduce-type-parameter.js +1 -0
- package/dist/rules/prefer-regexp-exec.js +1 -0
- package/dist/rules/prefer-return-this-type.js +1 -0
- package/dist/rules/prefer-string-starts-ends-with.js +1 -0
- package/dist/rules/prefer-ts-expect-error.js +1 -0
- package/dist/rules/promise-function-async.js +1 -0
- package/dist/rules/related-getter-setter-pairs.js +1 -0
- package/dist/rules/require-array-sort-compare.js +1 -0
- package/dist/rules/require-await.js +1 -0
- package/dist/rules/restrict-plus-operands.js +1 -0
- package/dist/rules/restrict-template-expressions.js +1 -0
- package/dist/rules/return-await.js +1 -0
- package/dist/rules/sort-type-constituents.js +1 -0
- package/dist/rules/strict-boolean-expressions.js +1 -0
- package/dist/rules/strict-void-return.d.ts +3 -2
- package/dist/rules/strict-void-return.js +97 -5
- package/dist/rules/switch-exhaustiveness-check.js +1 -0
- package/dist/rules/triple-slash-reference.js +1 -0
- package/dist/rules/typedef.js +1 -0
- package/dist/rules/unbound-method.js +1 -0
- package/dist/rules/unified-signatures.d.ts +1 -1
- package/dist/rules/unified-signatures.js +30 -4
- package/dist/rules/use-unknown-in-catch-callback-variable.js +1 -0
- package/dist/util/FunctionSignature.d.ts +15 -0
- package/dist/util/FunctionSignature.js +123 -0
- package/dist/util/assertionFunctionUtils.js +1 -0
- package/dist/util/astUtils.js +1 -0
- package/dist/util/baseTypeUtils.d.ts +2 -0
- package/dist/util/baseTypeUtils.js +17 -0
- package/dist/util/class-scope-analyzer/classScopeAnalyzer.js +1 -0
- package/dist/util/class-scope-analyzer/extractComputedName.js +1 -0
- package/dist/util/class-scope-analyzer/types.js +1 -0
- package/dist/util/collectUnusedVariables.js +1 -0
- package/dist/util/createRule.js +1 -0
- package/dist/util/escapeRegExp.js +1 -0
- package/dist/util/explicitReturnTypeUtils.js +1 -0
- package/dist/util/getBaseTypesOfClassMember.js +1 -0
- package/dist/util/getConstraintInfo.js +1 -0
- package/dist/util/getESLintCoreRule.js +1 -0
- package/dist/util/getFixOrSuggest.js +1 -0
- package/dist/util/getForStatementHeadLoc.js +1 -0
- package/dist/util/getFunctionHeadLoc.js +1 -0
- package/dist/util/getMemberHeadLoc.js +1 -0
- package/dist/util/getOperatorPrecedence.js +1 -0
- package/dist/util/getParentFunctionNode.js +1 -0
- package/dist/util/getStaticStringValue.js +1 -0
- package/dist/util/getStringLength.js +1 -0
- package/dist/util/getTextWithParentheses.js +1 -0
- package/dist/util/getThisExpression.js +1 -0
- package/dist/util/getValueOfLiteralType.js +1 -0
- package/dist/util/getWrappedCode.js +1 -0
- package/dist/util/getWrappingFixer.js +1 -0
- package/dist/util/hasOverloadSignatures.js +1 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +2 -0
- package/dist/util/isArrayMethodCallWithPredicate.js +1 -0
- package/dist/util/isAssignee.js +1 -0
- package/dist/util/isConditionalTest.js +1 -0
- package/dist/util/isHigherPrecedenceThanAwait.js +1 -0
- package/dist/util/isNodeEqual.js +1 -0
- package/dist/util/isNullLiteral.js +1 -0
- package/dist/util/isPromiseAggregatorMethod.js +1 -0
- package/dist/util/isStartOfArrowFunctionBody.js +1 -0
- package/dist/util/isStartOfExpressionStatement.js +1 -0
- package/dist/util/isTypeImport.js +1 -0
- package/dist/util/isUndefinedIdentifier.js +1 -0
- package/dist/util/misc.js +1 -0
- package/dist/util/needsPrecedingSemiColon.js +1 -0
- package/dist/util/needsToBeAwaited.js +1 -0
- package/dist/util/objectIterators.js +1 -0
- package/dist/util/promiseUtils.js +1 -0
- package/dist/util/rangeToLoc.js +1 -0
- package/dist/util/referenceContainsTypePredicate.js +1 -0
- package/dist/util/referenceContainsTypeQuery.js +1 -0
- package/dist/util/scopeUtils.js +1 -0
- package/dist/util/skipChainExpression.js +1 -0
- package/dist/util/truthinessUtils.js +1 -0
- package/dist/util/types.js +1 -0
- package/dist/util/walkStatements.js +1 -0
- package/package.json +12 -11
package/dist/configs/flat/all.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1096,7 +1096,7 @@ declare const _default: {
|
|
|
1096
1096
|
'strict-boolean-expressions': import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/strict-boolean-expressions").MessageId, import("./rules/strict-boolean-expressions").Options, import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
1097
1097
|
name: string;
|
|
1098
1098
|
};
|
|
1099
|
-
'strict-void-return': import("@typescript-eslint/utils/ts-eslint").RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn", [{
|
|
1099
|
+
'strict-void-return': import("@typescript-eslint/utils/ts-eslint").RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn" | "suggestAddVoidOp" | "suggestWrapInAsyncIIFE", [{
|
|
1100
1100
|
allowReturnAny?: boolean;
|
|
1101
1101
|
}], import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
1102
1102
|
name: string;
|
package/dist/index.js
CHANGED
package/dist/raw-plugin.d.ts
CHANGED
|
@@ -1119,7 +1119,7 @@ declare const _default: {
|
|
|
1119
1119
|
'strict-boolean-expressions': TSESLint.RuleModule<import("./rules/strict-boolean-expressions").MessageId, import("./rules/strict-boolean-expressions").Options, import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
|
|
1120
1120
|
name: string;
|
|
1121
1121
|
};
|
|
1122
|
-
'strict-void-return': TSESLint.RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn", [{
|
|
1122
|
+
'strict-void-return': TSESLint.RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn" | "suggestAddVoidOp" | "suggestWrapInAsyncIIFE", [{
|
|
1123
1123
|
allowReturnAny?: boolean;
|
|
1124
1124
|
}], import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
|
|
1125
1125
|
name: string;
|
package/dist/raw-plugin.js
CHANGED
package/dist/rules/array-type.js
CHANGED
|
@@ -19,6 +19,11 @@ export declare function getEnumLiterals(type: ts.Type): ts.LiteralType[];
|
|
|
19
19
|
* - T extends Fruit --> [Fruit]
|
|
20
20
|
*/
|
|
21
21
|
export declare function getEnumTypes(typeChecker: ts.TypeChecker, type: ts.Type): ts.Type[];
|
|
22
|
+
/**
|
|
23
|
+
* @returns Whether two types compare unsafely because an enum value is being
|
|
24
|
+
* compared against a non-enum value of the same primitive kind.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isMismatchedEnumComparisonTypes(typeChecker: ts.TypeChecker, leftType: ts.Type, rightType: ts.Type): boolean;
|
|
22
27
|
/**
|
|
23
28
|
* Returns the enum key that matches the given literal node, or null if none
|
|
24
29
|
* match. For example:
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getEnumLiterals = getEnumLiterals;
|
|
37
37
|
exports.getEnumTypes = getEnumTypes;
|
|
38
|
+
exports.isMismatchedEnumComparisonTypes = isMismatchedEnumComparisonTypes;
|
|
38
39
|
exports.getEnumKeyForLiteral = getEnumKeyForLiteral;
|
|
39
40
|
const tsutils = __importStar(require("ts-api-utils"));
|
|
40
41
|
const ts = __importStar(require("typescript"));
|
|
@@ -81,6 +82,72 @@ function getEnumLiterals(type) {
|
|
|
81
82
|
function getEnumTypes(typeChecker, type) {
|
|
82
83
|
return getEnumLiterals(type).map(type => getBaseEnumType(typeChecker, type));
|
|
83
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* @returns Whether two types compare unsafely because an enum value is being
|
|
87
|
+
* compared against a non-enum value of the same primitive kind.
|
|
88
|
+
*/
|
|
89
|
+
function isMismatchedEnumComparisonTypes(typeChecker, leftType, rightType) {
|
|
90
|
+
// Allow comparisons that don't have anything to do with enums:
|
|
91
|
+
//
|
|
92
|
+
// ```ts
|
|
93
|
+
// 1 === 2;
|
|
94
|
+
// ```
|
|
95
|
+
const leftEnumTypes = getEnumTypes(typeChecker, leftType);
|
|
96
|
+
const rightEnumTypes = new Set(getEnumTypes(typeChecker, rightType));
|
|
97
|
+
if (leftEnumTypes.length === 0 && rightEnumTypes.size === 0) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
// Allow comparisons that share an enum type:
|
|
101
|
+
//
|
|
102
|
+
// ```ts
|
|
103
|
+
// Fruit.Apple === Fruit.Banana;
|
|
104
|
+
// ```
|
|
105
|
+
for (const leftEnumType of leftEnumTypes) {
|
|
106
|
+
if (rightEnumTypes.has(leftEnumType)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// We need to split the type into the union type parts in order to find
|
|
111
|
+
// valid enum comparisons like:
|
|
112
|
+
//
|
|
113
|
+
// ```ts
|
|
114
|
+
// declare const something: Fruit | Vegetable;
|
|
115
|
+
// something === Fruit.Apple;
|
|
116
|
+
// ```
|
|
117
|
+
const leftTypeParts = tsutils.unionConstituents(leftType);
|
|
118
|
+
const rightTypeParts = tsutils.unionConstituents(rightType);
|
|
119
|
+
// If a type exists in both sides, we consider this comparison safe:
|
|
120
|
+
//
|
|
121
|
+
// ```ts
|
|
122
|
+
// declare const fruit: Fruit.Apple | 0;
|
|
123
|
+
// fruit === 0;
|
|
124
|
+
// ```
|
|
125
|
+
for (const leftTypePart of leftTypeParts) {
|
|
126
|
+
if (rightTypeParts.includes(leftTypePart)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return (typeViolates(leftTypeParts, rightType) ||
|
|
131
|
+
typeViolates(rightTypeParts, leftType));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @returns Whether the right type is an unsafe comparison against any left type.
|
|
135
|
+
*/
|
|
136
|
+
function typeViolates(leftTypeParts, rightType) {
|
|
137
|
+
const leftEnumValueTypes = new Set(leftTypeParts.map(getEnumValueType));
|
|
138
|
+
return ((leftEnumValueTypes.has(ts.TypeFlags.Number) && (0, util_1.isNumberLike)(rightType)) ||
|
|
139
|
+
(leftEnumValueTypes.has(ts.TypeFlags.String) && (0, util_1.isStringLike)(rightType)));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @returns What type a type's enum value is (number or string), if either.
|
|
143
|
+
*/
|
|
144
|
+
function getEnumValueType(type) {
|
|
145
|
+
return tsutils.isTypeFlagSet(type, ts.TypeFlags.EnumLike)
|
|
146
|
+
? tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLiteral)
|
|
147
|
+
? ts.TypeFlags.Number
|
|
148
|
+
: ts.TypeFlags.String
|
|
149
|
+
: undefined;
|
|
150
|
+
}
|
|
84
151
|
/**
|
|
85
152
|
* Returns the enum key that matches the given literal node, or null if none
|
|
86
153
|
* match. For example:
|
|
@@ -119,3 +186,4 @@ function getEnumKeyForLiteral(enumLiterals, literal) {
|
|
|
119
186
|
}
|
|
120
187
|
return null;
|
|
121
188
|
}
|
|
189
|
+
//# sourceMappingURL=shared.js.map
|
package/dist/rules/index.d.ts
CHANGED
|
@@ -421,7 +421,7 @@ declare const rules: {
|
|
|
421
421
|
'strict-boolean-expressions': import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./strict-boolean-expressions").MessageId, import("./strict-boolean-expressions").Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
422
422
|
name: string;
|
|
423
423
|
};
|
|
424
|
-
'strict-void-return': import("@typescript-eslint/utils/ts-eslint").RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn", [{
|
|
424
|
+
'strict-void-return': import("@typescript-eslint/utils/ts-eslint").RuleModule<"asyncFunc" | "nonVoidFunc" | "nonVoidReturn" | "suggestAddVoidOp" | "suggestWrapInAsyncIIFE", [{
|
|
425
425
|
allowReturnAny?: boolean;
|
|
426
426
|
}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
427
427
|
name: string;
|
package/dist/rules/index.js
CHANGED
package/dist/rules/max-params.js
CHANGED
|
@@ -9,3 +9,4 @@ var schema_1 = require("./schema");
|
|
|
9
9
|
Object.defineProperty(exports, "SCHEMA", { enumerable: true, get: function () { return schema_1.SCHEMA; } });
|
|
10
10
|
var shared_1 = require("./shared");
|
|
11
11
|
Object.defineProperty(exports, "selectorTypeToMessageString", { enumerable: true, get: function () { return shared_1.selectorTypeToMessageString; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -139,15 +139,13 @@ exports.default = (0, util_1.createRule)({
|
|
|
139
139
|
if (!canFix(arrowFunction)) {
|
|
140
140
|
return null;
|
|
141
141
|
}
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
return fixer.replaceText(arrowBody, newArrowBodyText);
|
|
142
|
+
const arrowToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(arrowFunction.body, {
|
|
143
|
+
filter: token => token.value === '=>',
|
|
144
|
+
}), util_1.NullThrowsReasons.MissingToken('arrow token', 'before arrow function body'));
|
|
145
|
+
return [
|
|
146
|
+
fixer.replaceTextRange([arrowToken.range[1], arrowFunction.body.range[0]], ' { '),
|
|
147
|
+
fixer.replaceTextRange([arrowFunction.body.range[1], arrowFunction.range[1]], '; }'),
|
|
148
|
+
];
|
|
151
149
|
},
|
|
152
150
|
});
|
|
153
151
|
}
|
|
@@ -355,3 +353,4 @@ exports.default = (0, util_1.createRule)({
|
|
|
355
353
|
}
|
|
356
354
|
},
|
|
357
355
|
});
|
|
356
|
+
//# sourceMappingURL=no-confusing-void-expression.js.map
|