Skip to content

@stylexjs/eslint-plugin: Confusing error message when a value is disallowed with null #282

Open
@tjosepo

Description

The problem

When disallowing a property with the ESLint plugin, the error message is:

{property} value must be one of:
{reason}

While not completely incorrect, it's slightly misleading to say value must be one of: when there is no valid value.

Without knowing how the rule is defined, it's also possible to confuse the {reason} as the possible value.

How to reproduce

ESLint configuration

image

Error message

image

Expected behavior

I expect the error message to clearly indicate that the property is disallowed.

e.g.

Using {property} is not allowed. {reason}

Environment (include versions). Did this work in previous versions?


It seems like a good first issue, so let me know if you'd like me to tackle it 🫡

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions