Skip to content

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

@mrtnzlml

Description

@mrtnzlml

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions