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
button-has-type is not allowing a ternary statement #2969
Comments
I believe, because |
I just tried moving it as you suggested and removing otherProps entirely. Neither worked and there was no change to the error description. =/ |
What version of the plugin are you using? |
|
Indeed d8741de should be in v7.21.0+ via #2748. (cc @Hypnosphi) This seems like a bug. |
@jason-chen-kiewit please share your eslint config. I can't reproduce it with just |
Thanks for looking into this! eslintrc.json
|
I tried to replicate your setup and I only get an error from
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@Hypnosphi thanks for trying to replicate it, I think this means that there is something specific in my setup that is not right... Would love to hear ideas on where to start looking though. ><; |
Wait - you’re getting this error in your ide, not on the command line? |
The command line is the source of truth; if it works properly there it’s an issue with the editor. Note that every editor I’m aware of needs to be restarted after an npm install before it picks up the new eslint stuff. |
@ljharb You're right! I have husky to prevent the commit from happening if it finds an error and it looks like it went through no problem. still weird... but I'll take it. |
Does restarting your editor fix the problem? |
@ljharb Yes it does... I had updated to the newest version and I didn't think to restart my vscode. 🤦 Thank you for all the help regardless! |
I'm trying to add a ternary statement to dynamically determine which type to apply to this button component. According to https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md, this should work?
The error message:
My code:
The text was updated successfully, but these errors were encountered: