Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

no-redeclare: false positives for type definitions #443

Closed
@OliverJAsh

Description

@OliverJAsh

What version of TypeScript are you using?
2.6.1

What version of typescript-eslint-parser are you using?
12.0.0

What code were you trying to parse?

const Foo = 1;
// unexected error: 'Foo' is already defined. (no-redeclare)
type Foo = 1;

We've decided to disable this ESLint rule as TypeScript also provides similar functionality anyway, but logging this just for others/reference.

For context, this pattern is common when using unionize:

import { unionize, ofType } from 'unionize'

export const Action = unionize({
  ADD_TODO:                ofType<{ id: string; text: string }>(),
  SET_VISIBILITY_FILTER:   ofType<'SHOW_ALL' | 'SHOW_ACTIVE' | 'SHOW_COMPLETED'>(),
  TOGGLE_TODO:             ofType<{ id: string }>(),
});

export type Action = typeof Action._Union;

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