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

[explicit-function-return-type] Conflicts with typescript rule on setters #525

Closed
calling opened this issue May 13, 2019 · 0 comments
Closed
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@calling
Copy link

calling commented May 13, 2019

Repro

{
  "rules": {
    "typescript/explicit-function-return-type": ["error"]
  }
}
const myObj = {
  set myProp(val) {
    this.myProp = val;
  },
};

Expected Result
No error. Adding an explicit return type causes the following TS error: A 'set' accessor cannot have a return type annotation.ts(1095)
Actual Result
Missing return type on function.eslint(@typescript-eslint/explicit-function-return-type)
Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.7.0
@typescript-eslint/parser 1.7.0
TypeScript 3.4.5
ESLint 5.3.0
node 10.15.3
npm 6.9.0
@calling calling added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels May 13, 2019
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels May 13, 2019
@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 package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants