gajus / eslint-plugin-flowtype

Flow type linting rules for ESLint.
Other
1.08k stars 153 forks source link

feat: add support for enum type #512

Closed maxcnunes closed 1 year ago

maxcnunes commented 2 years ago

Add support for the enum type usage https://flow.org/en/docs/enums/.

Fixes https://github.com/gajus/eslint-plugin-flowtype/issues/502.

Something I found during the tests, if you use @babel/plugin-syntax-flow plugin, then the babel-plugin-transform-flow-enums plugin must be placed before @babel/plugin-syntax-flow, otherwise the parser won't recognize the enum type. But, I think you could even remove @babel/plugin-syntax-flow if you are using babel-plugin-transform-flow-enums.

maxcnunes commented 2 years ago

hey @gajus, when you have some time, could you please check this PR? thanks 🙇

maxcnunes commented 1 year ago

Closing this in favor of https://github.com/flow-typed/eslint-plugin-ft-flow which has implemented it already