Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

ban-single-arg-parens doesn't work with return type declarations #2237

Closed
felixfbecker opened this issue Feb 25, 2017 · 0 comments · Fixed by #2265 or singapore/lint-condo#263
Closed

Comments

@felixfbecker
Copy link

Bug Report

  • TSLint version: 4.4.2
  • TypeScript version: 2.2.0
  • Running TSLint via: (pick one) anything

TypeScript code being linted

const fn = (param): ReturnType {
  // whatever
}

with tslint.json configuration:

		"arrow-parens": [true, "ban-single-arg-parens"],

Actual behavior

Parentheses are prohibited around the parameter in this single parameter arrow function

If you remove the parenthesis, TypeScript will not be able to compile the file. Parenthesis are required if you declare a return type.

Expected behavior

No error if a return type is declared

nchen63 pushed a commit that referenced this issue Mar 6, 2017
[bugfix] `arrow-parens` with option `ban-single-arg-parens` now correctly handles functions with return type annotation
Fixes: #2237
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants