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

Multiline trailing comma rule flags type parameters 2 #1905

Closed
mizunashi-mana opened this issue Dec 18, 2016 · 1 comment · Fixed by #2236
Closed

Multiline trailing comma rule flags type parameters 2 #1905

mizunashi-mana opened this issue Dec 18, 2016 · 1 comment · Fixed by #2236

Comments

@mizunashi-mana
Copy link

Bug Report

  • TSLint version: 4.1.1
  • TypeScript version: 2.1.4
  • Running TSLint via: gulp-tslint

TypeScript code being linted

var foo = <
  A,
  B
>(a: A, b: B) => 42;
function foo(a: [
  number,
  string
]): void {
  return 42; 
}

with tslint.json configuration:

{
    "trailing-comma": [true, {"multiline": "always", "singleline": "never"}]
}

Actual behavior

var foo = <
  A,
  B
   ~ [Missing trailing comma]
>(a: A, b: B) => 42;
function foo(a: [
  number,
  string
  ~ [Missing trailing comma]
]): void {
  return 42; 
}

This is invalid typescript code. Related: #1769

Expected behavior

var foo = <
  A,
  B
>(a: A, b: B) => 42;
function foo(a: [
  number,
  string
]): void {
  return 42; 
}
@nchen63
Copy link
Contributor

nchen63 commented Jan 22, 2017

also from #1769, this fails:

function foo(a: [
  number,
  string
  ~ [Missing trailing comma] // expecting no warnings
]): void {
  return 42; 
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants