import-js/eslint-plugin-import

Support Flow Enums

Ouverte

#2 073 ouverte le 14 mai 2021

 (8 commentaires) (4 réactions) (0 personne assignée)JavaScript (1 548 forks)batch import
enhancementflowhelp wanted

Métriques du dépôt

Stars
 (5 940 étoiles)
Métriques de merge PR
 (Merge moyen 138j 22h) (3 PRs mergées en 30 j)

Description

Babel added support for flow enums here: https://github.com/babel/babel/pull/10344

Currently trying to import an enum results in MyEnum not found in enum-module

They're currently experimental, but should be coming down the pipe. I think it would be pretty trivial to support these, basically add an EnumDeclaration everywhere there is currently a TSEnumDeclaration.

I tried working on a PR for this, but the problem is getting the tests running. EnumDeclaration was added in babel 7.7.0. I was trying to get @babel/eslint-parser going in all the flow-related tests while retaining babel-eslint in other tests, but I kept running into problems.

Guide contributeur