Skip to content

Object.keys considered a component #93

@CodeSmith32

Description

@CodeSmith32

We were using this plugin, but it appeared that Object.keys was considered a 'component' somehow, and raised a warning in a file consisting of solely constants and constant logic. e.g.

// A type-safe way to maintain a list of enum values as a javascript array:
export const TABLE: Record<EnumType, true> = {
  key1: true,
  key2: true,
  key3: true,
}
export const ENUM_VALUES = Object.keys(TABLE) as EnumType[];

Because the first letter of the constant name, ENUM_VALUES is capital, it could be a component. I'm not sure what the parser looks at after that, but apparently Object.keys(...) looks too much like a component, when it most definitely isn't.

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