Skip to content

PascalCase constant is classified as a component #71

Description

@githorse

I think perhaps I'm seeing the converse of #26: I use PascalCase for my constants, and the plugin considers erroneously them to be components. An example that will trigger the rule:

export const SomeConstant = 42 // ✗  [eslint] Fast refresh only works when a file only exports components ... 
export function someUtility() { return SomeConstant }

If I change that the capitalization to screaming snake, it passes:

export const SOME_CONSTANT = 42 // ✓
export function someUtility() { return SOME_CONSTANT }

OK, I guess PascalCase is not the preferred convention here. But is there any global setting I'm missing that could easily prevent such constants from being flagged? (Using eslint-disable-next-line is more distracting than it's worth; if I have to do that I'll probably just switch to screaming snake, but that's not my preference.)

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