-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[explicit-module-boundary-types] Complains about inner function expressions #1845
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
Comments
I just came here to post the same issue after upgrading to Is anyone currently working on this? I can take a look otherwise. |
feel free! currently the rule recursively checks functions in case you are doing a higher-order function: Should be a simple enough fix though - it shouldn't do this recursive check if the parent function has a type annotation. |
Was complaining about inner function expressions. Fixes typescript-eslint#1845
Okay, I've pushed up a potential fix. It's a really high quality codebase. I've never worked with AST's before but the logic and tests here are structured really well. I think TypeScript together with https://astexplorer.com really helps. |
Was complaining about inner function expressions. Fixes typescript-eslint#1845
Was complaining about inner function expressions. Fixes typescript-eslint#1845
Was complaining about inner function expressions. Fixes typescript-eslint#1845
Was complaining about inner function expressions. Fixes typescript-eslint#1845
Just installed 3.1.0. The example function from the opening post still gives the same error for me.
"Missing return type on function." Already reinstalled all packages and cleared cache.
|
There is a passing test for this exact case in master, so it should be working fine. typescript-eslint/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts Lines 471 to 477 in c86e2a2
Could you please:
|
Repro
Expected Result
Since the module boundary (
foo
) is fully typed, I would not expect to have to type the inner function expression.Actual Result
explicit-function-return-type
permits this code when theallowExpressions
option is enabled. Butexplicit-module-boundary-types
complains that the argument and return value of the inner function expression are untyped, and the rule doesn't have a corresponding expressions option.Additional Info
n/a
Versions
@typescript-eslint/eslint-plugin
2.26.0
@typescript-eslint/parser
2.26.0
TypeScript
3.8.3
ESLint
6.8.0
node
13.11.0
npm
6.14.4
The text was updated successfully, but these errors were encountered: