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

Add interface-over-type-literal rule #1890

Merged
merged 2 commits into from Dec 17, 2016
Merged

Add interface-over-type-literal rule #1890

merged 2 commits into from Dec 17, 2016

Conversation

ghost
Copy link

@ghost ghost commented Dec 16, 2016

PR checklist

What changes did you make?

Added the interface-over-type-literal rule. This forbids type T = { ... }, preferring interface T { ... }.

@@ -27,7 +27,6 @@ export class Rule extends Lint.Rules.AbstractRule {
rationale: "An empty interface is equivalent to its supertype (or `{}`).",
optionsDescription: "Not configurable.",
options: null,
optionExamples: ["true"],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was left in by accident.

@nchen63 nchen63 merged commit 555549f into palantir:master Dec 17, 2016
@nchen63
Copy link
Contributor

nchen63 commented Dec 17, 2016

@andy-ms thanks!

@ghost ghost deleted the interface_over_type_literal branch December 17, 2016 19:05
@itajaja
Copy link

itajaja commented Jan 18, 2017

Hi, just out of curiosity, can you point me to some rationale behind this?

@ghost
Copy link
Author

ghost commented Jan 18, 2017

It's stylistic. Generally interface T { foo(): void; } and type T = { foo(): void; } mean the same thing (although an interface can be extended). I think the latter style was mostly coming from people familiar with flow, where there is a difference.

@itajaja
Copy link

itajaja commented Jan 18, 2017

thanks for the explanation :)

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

Successfully merging this pull request may close these issues.

2 participants