flow-typed / eslint-plugin-ft-flow

https://www.npmjs.com/package/eslint-plugin-ft-flow
Other
18 stars 11 forks source link

Allow mixed type-import-style #37

Open FezVrasta opened 1 year ago

FezVrasta commented 1 year ago

I'd like to ensure no side effects are introduced by type imports, that means if I only import a type from a module, it should use the declaration syntax (import type { X } from 'y').

If I import a mix of types and normal exports from a module though, I don't care about this:

// this separation is not useful as the first import will run any module side effects.
import { X } from 'y';
import type { Z } from 'y';

Right now the type-import-style rule doesn't allow to specify this. Do you think it could be implemented?

Brianzchen commented 1 year ago

If you use the declaration style doesn't that solve it already? Because import { a, type A } from 'blah' would already be banned.

I'm not quite sure I understand, but I'm happy for any contributions