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

import/export: false positives #444

Closed
OliverJAsh opened this issue Feb 7, 2018 · 2 comments
Closed

import/export: false positives #444

OliverJAsh opened this issue Feb 7, 2018 · 2 comments

Comments

@OliverJAsh
Copy link

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?

// 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 = 1;

The import/export rule is defined here: https://github.com/benmosher/eslint-plugin-import/blob/219a8d2e5af230f73b4754f725916843645889ff/docs/rules/export.md

Is this an issue to log here or with the eslint-plugin-import project?

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

A custom rule will need to be created in the plugin to handle this. It would be fantastic if one of the people affected by this issue could contribute to it.

@OliverJAsh OliverJAsh changed the title import/export false positives import/export: false positives Jun 11, 2018
@JamesHenry
Copy link
Member

This issue has been migrated to the new project: typescript-eslint/typescript-eslint#10

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants