Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 765 Bytes

File metadata and controls

40 lines (31 loc) · 765 Bytes

ts-naming-options

Requires client method options parameter types to be suffixed with Options and prefixed with the method name.

Examples

Good

class ServiceClient {
  constructor(options: ServiceClientOptions) {
    /* code */
  }
  createItem(options: CreateItemOptions): Item {
    /* code to return instance of Item */
  }
  upsertItem(options: UpsertItemOptions): Item {
    /* code to return instance of Item */
  }
}

Bad

class ServiceClient {
  constructor(options: Options) {
    /* code */
  }
  createItem(options: Options): Item {
    /* code to return instance of Item */
  }
}

When to turn off

Only if the rule breaks.