-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
react/boolean-prop-naming interface does not work #3285
Comments
Any updates? |
@AgentRBY nope, if there were updates, they'd be posted in the issue, or there'd be a linked PR. (that's true everywhere on github) |
It does not work with inline-defined prop types either. I would not suggest anyone use inline types, but it might help locate this problem. Example for getting no error even with @DavidShefcik's rule enabled: const TestComponent: FC<{
isEnabled: boolean;
enabled: boolean;
}> = ({ isEnabled, enabled }) => {
//...
}; |
This comment was marked as spam.
This comment was marked as spam.
It seems like now at |
@ofelipescherer can you provide a repro? what code and config isn't working as you expect on the command line? |
Yes, of course. I created a sandbox demo. The prop |
I've never been able to get custom ESLint configuration working in CodeSandbox; I found a couple of issues asking for it but I don't think it ever has been added (at least, I have never been able to get it to recognize my config files, but maybe I'm just missing something). Using your sandbox as a baseline I can't get any other rules or plugins set in a config file to work either. In a local test repo, it does work with a props declared with a "react/boolean-prop-naming": ["warn", {}], But I don't think that is related to the original issue of it not working on |
Yeah, you are right. I tested again in local and worked. I probably made some mistake on the first time tried. Thanks |
This is still an issue; also adding other broken scenarios: Extending the type also fails:
Passing the type as a generic also fails
|
Still an issue -- if i change any |
The
react/boolean-prop-naming
rule does not work when using an interface with TypeScript but it works with atype
This shows an error like it should:
This doesn't show an error like it should:
My usage of the rule:
Versions:
8.15.0
7.29.4
The text was updated successfully, but these errors were encountered: