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

no-duplicate-super rule does not validate when using a ternary operator #3275

Closed
Nysosis opened this issue Oct 4, 2017 · 1 comment
Closed

Comments

@Nysosis
Copy link

Nysosis commented Oct 4, 2017

Bug Report

  • TSLint version: 5.3.2
  • TypeScript version: 2.3.4
  • Running TSLint via: CLI

TypeScript code being linted

class Base {
	constructor(props?: any) { }
}

class IfElse extends Base {
	constructor(props?: any) {
		if (props) {
			super(props)
		} else {
			super()
		}
	}
}

class Ternary extends Base {
	constructor(props?: any) {
		props ? super(props) : super()
	}
}

with tslint.json configuration:

{
	"rules": {
		"no-duplicate-super": true
	}
}

Actual behavior

Class named Ternary is failing to pass the no-duplicate-super rule

Expected behavior

Class named Ternary to pass the no-duplicate-super rule

@ajafff
Copy link
Contributor

ajafff commented Dec 5, 2017

Fixed by #3544

@ajafff ajafff closed this as completed Dec 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants