Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: incorrect no-undef error for Flow Enums #502

Open
mrtnzlml opened this issue Sep 14, 2021 · 1 comment
Open

Bug: incorrect no-undef error for Flow Enums #502

mrtnzlml opened this issue Sep 14, 2021 · 1 comment

Comments

@mrtnzlml
Copy link
Contributor

I know this sounds like it's not a problem with this plugin but bear with me.

Problematic code:

// @flow strict

enum Status {
  Active,
  Paused,
  Off,
}

This code uses the new Flow Enums. Eslint throws the following errors:

  3:6  error  'Status' is not defined  no-undef
  4:3  error  'Active' is not defined  no-undef
  5:3  error  'Paused' is not defined  no-undef
  6:3  error  'Off' is not defined     no-undef

It should not throw anything (at least not no-undef).

We already have define-flow-type that seems to be solving the issue for other Flow specifics (code). I think we have to extend this rule to support Flow Enums correctly.

mrtnzlml added a commit to adeira/universe that referenced this issue Sep 14, 2021
There is currently one issue with `no-undef` rule (see: gajus/eslint-plugin-flowtype#502)
but I think we can proceed with this and continue with the ecosystem
fixing.

See: https://flow.org/en/docs/enums/
kodiakhq bot pushed a commit to adeira/universe that referenced this issue Sep 15, 2021
There is currently one issue with `no-undef` rule (see: gajus/eslint-plugin-flowtype#502)
but I think we can proceed with this and continue with the ecosystem
fixing.

See: https://flow.org/en/docs/enums/
adeira-github-bot pushed a commit to adeira/eslint-config-adeira that referenced this issue Sep 15, 2021
There is currently one issue with `no-undef` rule (see: gajus/eslint-plugin-flowtype#502)
but I think we can proceed with this and continue with the ecosystem
fixing.

See: https://flow.org/en/docs/enums/

adeira-source-id: 1898e8ac4f97e8c49ef2710a1639ddd0fda86bfc
@mrtnzlml
Copy link
Contributor Author

This issue seems to be fixed in the newly released descendant of this plugin: https://github.com/flow-typed/eslint-plugin-ft-flow

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jul 20, 2022
This has more recent releases, and the repo lives in the actual Flow
Typed org:
  https://github.com/flow-typed/eslint-plugin-ft-flow

(The original, which we've been using until now, lives at
  https://github.com/gajus/eslint-plugin-flowtype .)

Also, the fork brings awareness of Flow enums, so that the
"no-undef" rule doesn't give us spurious errors in enum definitions:
  gajus/eslint-plugin-flowtype#502 (comment)
We'd like to use Flow enums soon.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Jul 26, 2022
This has more recent releases, and the repo lives in the actual Flow
Typed org:
  https://github.com/flow-typed/eslint-plugin-ft-flow

(The original, which we've been using until now, lives at
  https://github.com/gajus/eslint-plugin-flowtype .)

Also, the fork brings awareness of Flow enums, so that the
"no-undef" rule doesn't give us spurious errors in enum definitions:
  gajus/eslint-plugin-flowtype#502 (comment)
We'd like to use Flow enums soon.
gnprice pushed a commit to zulip/zulip-mobile that referenced this issue Aug 3, 2022
This has more recent releases, and the repo lives in the actual Flow
Typed org:
  https://github.com/flow-typed/eslint-plugin-ft-flow

(The original, which we've been using until now, lives at
  https://github.com/gajus/eslint-plugin-flowtype .)

Also, the fork brings awareness of Flow enums, so that the
"no-undef" rule doesn't give us spurious errors in enum definitions:
  gajus/eslint-plugin-flowtype#502 (comment)
We'd like to use Flow enums soon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant