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

How to use object literals in array with no-object-literal-type-assertion? #2923

@CSchulz

Description

@CSchulz

Bug Report

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

TypeScript code being linted

@NgModule({
  providers: [
    <FactoryProvider> {
      deps: [LOG_ROOT_FACTORY],
      provide: LOG_FACTORY,
      useFactory: createLogger,
    },
  ],
})

with tslint.json configuration:

"no-object-literal-type-assertion": true

Behavior

It complains about the <FactoryProvider>.

It would be nice to have an example how to use it in such cases. Should every provider hold as const?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions