stylex icon indicating copy to clipboard operation
stylex copied to clipboard

[eslint-plugin] Confusing error message when a value is disallowed with `null`

Open tjosepo opened this issue 2 years ago • 1 comments

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?

@stylexjs/[email protected]

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

tjosepo avatar Dec 29 '23 23:12 tjosepo

@tjosepo Yes, this is a known issue. You're welcome to take a crack at it, but I wouldn't say it's the easiest issue to tackle!

nmn avatar Dec 30 '23 01:12 nmn