Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-implicit-any-catch throws an error #122

Open
cerealcable opened this issue Sep 5, 2023 · 2 comments · May be fixed by #129
Open

no-implicit-any-catch throws an error #122

cerealcable opened this issue Sep 5, 2023 · 2 comments · May be fixed by #129

Comments

@cerealcable
Copy link

When no-implicit-any-catch encounters a catchError statement without any types we end up getting an error. See cartant/eslint-plugin-etc#63 as this happens in this repository as well.

It appears cartant/eslint-etc#12 fixes the problem for us. Hoping we could get a review and merge on that PR? Once I used the contents of that PR it resolved this error for us. We'd like to enable the no-implicit-any-catch rule but need this merged to do so.

@sjarva
Copy link

sjarva commented Sep 14, 2023

We have a similar situation, but I'd like to add that even with a disabling comment for this no-implicit-any-catch rule, eslint lint process is stopped by an exception/error. This is really inconvenient because we have already enabled this rule and in some cases we have had to use the disabling comment, and now the exception/error breaks our lint, which is one step in our CI/CD. So we had to turn this rule off while we wait for a fix.

@merkuriy
Copy link

merkuriy commented Jan 21, 2024

We have a similar situation. We had to turn this rule off while we wait for a fix.

Example:

of(1).pipe(
    catchError((err) => {
        return of(2);
    }),
);

Log:

TypeError: Cannot read properties of undefined (reading 'typeAnnotation')
Occurred while linting ./src/file.ts:11
Rule: "rxjs/no-implicit-any-catch"
    at checkCallback (./node_modules/eslint-plugin-rxjs/dist/rules/no-implicit-any-catch.js:60:59)
    at CallExpression[callee.name='catchError'] (./node_modules/eslint-plugin-rxjs/dist/rules/no-implicit-any-catch.js:126:17)
    at ruleErrorHandler (./node_modules/eslint/lib/linter/linter.js:1076:28)
    at ./node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (./node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (./node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (./node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (./node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (./node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:803:23)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants