import-js/eslint-plugin-import

Re-exporting all flow types can cause trouble with export rule

Open

#1,937 opened on Nov 5, 2020

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

Description

file-a.js

// @flow
const Bar = 'Bar';

export {Bar};

file-b.js

// @flow

export {Bar} from './file-a';

export type * from './file-a';

export type * is read by export rule as exporting everything inside file-a.js (not just the types), so it causes:

file-b.js
  3:9  error  Multiple exports of name 'Bar'  import/export
  5:1  error  Multiple exports of name 'Bar'  import/export

Contributor guide