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

fix(eslint-plugin): support object types and as expressions [explicit-func-return-type] #459

Merged
merged 1 commit into from Apr 24, 2019

Conversation

bradzacher
Copy link
Member

Fixes #408

Adds support for 3 cases:

let asTyped = (() => '') as () => string;

interface ObjectType {
  foo(): number;
}
let objectProp: ObjectType = {
  foo: () => 1,
};

interface ObjectType {
  foo(): number;
}
let asObjectProp = {
  foo: () => 1,
} as ObjectType;

@bradzacher bradzacher added the bug Something isn't working label Apr 23, 2019
@codecov
Copy link

codecov bot commented Apr 23, 2019

Codecov Report

Merging #459 into master will decrease coverage by 0.05%.
The diff coverage is 87.5%.

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
- Coverage   97.14%   97.09%   -0.06%     
==========================================
  Files          74       74              
  Lines        2875     2891      +16     
  Branches      473      479       +6     
==========================================
+ Hits         2793     2807      +14     
- Misses         49       51       +2     
  Partials       33       33
Impacted Files Coverage Δ
...-plugin/src/rules/explicit-function-return-type.ts 93.93% <87.5%> (-6.07%) ⬇️

@JamesHenry JamesHenry merged commit d19e512 into master Apr 24, 2019
@JamesHenry JamesHenry deleted the 408-prop-explicit-function-return-type branch April 24, 2019 12:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explicit-function-return-type] false positives with typed function expressions in interfaces
2 participants