Skip to content

no-implicit-any-catch fixer produces invalid code for catchError #224

Closed
@JasonWeinzierl

Description

@JasonWeinzierl

When adding : unknown to the error callback argument of the following example, invalid code is produced:

import { throwError, catchError } from 'rxjs';

throwError(new Error('Kaboom!')).pipe(
  catchError((error, caught) => console.error(error)),
);

Invalid output:

import { throwError, catchError } from 'rxjs';

throwError(new Error('Kaboom!')).pipe(
  catchError(((error: unknown), caught) => console.error(error)),
);

This was reported and fixed in the smarttools fork: DaveMBush/eslint-plugin-rxjs#176

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions