import-js/eslint-plugin-import

false positive no-unused-modules with Flow

オープン

#1,539 opened on 2019/11/13

 (2 件のコメント) (2 件のリアクション) (0 人の担当者)JavaScript (1,549 件のフォーク)batch import
bugflowhelp wanted

Repository metrics

Stars
 (5,939 個のスター)
PR merge metrics
 (平均マージ 138d 22h) (30d で 3 merged PRs)

説明

When type import goes before default import from the same file, the default export is marked as unused:

// foo.js

// @flow strict
export type Foo = string
export default ''
// index.js

// @flow strict
import type {Foo} from './foo'
import foo from './foo'

3:1 error exported declaration 'default' not used within other modules import/no-unused-modules

It works OK if I change the imports order:

// index.js

// @flow strict
import foo from './foo'
import type {Foo} from './foo'

Repro: https://github.com/Hypnosphi/no-unused-modules-repro

コントリビューターガイド