Bug Report
We have migrated our codebase from 6.6.6 to 7.2.0 and have a an issue for mapTo(true) operator from eslint:
ESLint: Unsafe argument of type `OperatorFunction<any, boolean>` assigned to a parameter of type `OperatorFunction<DeleteResult, boolean>`.(@typescript-eslint/no-unsafe-argument)
Investigating the sources:
export function mapTo<R>(value: R): OperatorFunction<any, R>;
/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */
export function mapTo<T, R>(value: R): OperatorFunction<T, R>;
Current Behavior
ESLint error is shown, without providing generics for mapTo operator.
Expected behavior
No ESLint errors, without additional generics for mapTo operator.
Reproduction
Environment
- Runtime: Node v16.1.0
- RxJS version: 7.2.0
Possible Solution
Seems like the problem is with any, changing the type to use generics, fixes the issue, and you can use it in your code without specifying them:
export declare function mapTo<T, R>(value: R): OperatorFunction<T, R>;
Bug Report
We have migrated our codebase from 6.6.6 to 7.2.0 and have a an issue for
mapTo(true)operator from eslint:Investigating the sources:
Current Behavior
ESLint error is shown, without providing generics for mapTo operator.
Expected behavior
No ESLint errors, without additional generics for mapTo operator.
Reproduction
Environment
Possible Solution
Seems like the problem is with
any, changing the type to use generics, fixes the issue, and you can use it in your code without specifying them: