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

Comments

Projects
None yet
2 participants
@calling
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.