import-js/eslint-plugin-import

Inconsistent import/prefer-default-export with Flow type

Open

#1,164 opened on Aug 23, 2018

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
bugflowhelp wanted

Description

The following file is generating a warning that default export should be used.

Prefer default export. (import/prefer-default-export)

/* @flow */

export type AnswerState = {
  foo: string
}

export const answer: AnswerState = {
  foo: ''
}

This one however, is not generating any errors or warnings.

/* @flow */

- export type AnswerState = {
+ type AnswerState = {
  foo: string
}

export const answer: AnswerState = {
  foo: ''
}

+ export type { AnswerState }

Originally posted in #484.

Contributor guide