Skip to content

false positive no-unused-modules with Flow #1539

Open
@Hypnosphi

Description

@Hypnosphi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions