Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tjosepo opened this issue Dec 29, 2023 · 1 comment · May be fixed by #283
Open

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

tjosepo opened this issue Dec 29, 2023 · 1 comment · May be fixed by #283
Labels
bug Something isn't working

Comments

@tjosepo
Copy link

tjosepo commented Dec 29, 2023

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/eslint-plugin@0.4.1

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

@nmn nmn added bug Something isn't working good first issue Good for newcomers and removed good first issue Good for newcomers labels Dec 30, 2023
@nmn
Copy link
Contributor

nmn commented Dec 30, 2023

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants