import-js/eslint-plugin-import

false positive no-unused-modules with Flow

Aberta

#1.539 aberto em 13 de nov. de 2019

 (2 comentários) (2 reações) (0 responsável)JavaScript (1.548 forks)batch import
bugflowhelp wanted

Métricas do repositório

Stars
 (5.940 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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

Guia do colaborador