Skip to content

import/export: false positives for typescript type + value export #1318

@bradzacher

Description

@bradzacher

Reporting from typescript-eslint/typescript-eslint#10
The following code is valid typescript (even though it's a bit weird).

// unexected error: Multiple exports of name 'Foo'. (import/export)
export const Foo = 1;
// unexected error: Multiple exports of name 'Foo'. (import/export)
export type Foo = string;

When importing this, it causes the name to work as both a type and a value.

import { Foo } from './foo';

const x: Foo = 'string val';
const y = Foo; // === 1

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