Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bradzacher opened this issue Apr 12, 2019 · 2 comments · Fixed by #1319
Closed

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

bradzacher opened this issue Apr 12, 2019 · 2 comments · Fixed by #1319

Comments

@bradzacher
Copy link
Contributor

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
@ljharb
Copy link
Member

ljharb commented Apr 12, 2019

This seems like the same issue as #923.

@bradzacher
Copy link
Contributor Author

@ljharb - looking at #923 - that is about a different rule (named).
Also it also looks like it's about flow, where the code in the OP is not valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants