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

prefer-default-export fails on Typescript type declaration #1332

Closed
sharmilajesupaul opened this issue Apr 16, 2019 · 5 comments · Fixed by #1377
Closed

prefer-default-export fails on Typescript type declaration #1332

sharmilajesupaul opened this issue Apr 16, 2019 · 5 comments · Fixed by #1377

Comments

@sharmilajesupaul
Copy link
Contributor

import/prefer-default-export erroneously warns on files that contain a single exported type.

eg:

// foo.ts 

export type Foo = { // `prefer-default-export` fails on this line
 bar: string;
};

Related issue: #1164

@thisissami
Copy link

Not sure if this helps or not, but this was addressed once a while back: #639 seems like this bug was reintroduced.

@ljharb
Copy link
Member

ljharb commented Jun 8, 2019

That was for flow, this is for typescript.

@thisissami
Copy link

@ljharb my assumption based off of #1164 is that it is broken for both typesript and flow

@thisissami
Copy link

thisissami commented Jun 8, 2019

and if I'm not mistaken, both typescript and flow use the identical

export type insert_type_name_here

syntax, so unless the parser was explicitly looking for // @flow at the top of a file - it should work identically for each.

@mkaraula
Copy link

👋 are there any news on this?

ljharb pushed a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
ljharb pushed a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
ljharb pushed a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
sharmilajesupaul added a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
sharmilajesupaul added a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
sharmilajesupaul added a commit to sharmilajesupaul/eslint-plugin-import that referenced this issue Jul 17, 2019
@ljharb ljharb closed this as completed in f4e3f1b Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants