This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 886
trailing-comma rule should be smarter about interfaces #1810
Comments
@adidahiya I'm trying to get failing tests to reproduce this issue, but still no errors on I'm altering files in {
"rules": {
"trailing-comma": [true, {"multiline": "always"}]
}
}
interface Post {
title: string
age: number
}
interface Post2 {
title: string,
age: number
} Am I missing something? |
This was referenced Feb 24, 2017
Also, please consider cases such as: type EventEmitterMap = {
[K in keyof DocumentEventMap]: EventEmitter<K>
} & {
onfoo: EventEmitter<{foo: Foo}>
onbar: EventEmitter<{bar: Bar}>
} |
It would be nice to require trailing commas for array literals, object literals, function declarations and function calls, and type literals, but also require that no commas are ever used at the end of lines for |
What is the status here? |
This should have been fixed by #2236. 🎉 Closing for housekeeping purposes, but please do file a new issue or comment here if that's not the case! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Interfaces can be written with semicolon delimiters, comma delimiters, or no delimiter at all.
Currently, TSLint will require the following trailing comma if you don't use any delimiter, and this is awkward:
Proposal: enhance the rule logic to only require the trailing comma if the other fields have trailing commas.
reported by @schickling and @Zjaaspoer in #960
The text was updated successfully, but these errors were encountered: