Skip to content

[Docs]: Add docs for customValidators #3664

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

Open
2 tasks done
KATT opened this issue Dec 12, 2023 · 5 comments
Open
2 tasks done

[Docs]: Add docs for customValidators #3664

KATT opened this issue Dec 12, 2023 · 5 comments

Comments

@KATT
Copy link

KATT commented Dec 12, 2023

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

@JoshuaKGoldberg suggested I should post an issue here 🙃

Expected Behavior

A code example on how to use customVAlidators

eslint-plugin-react version

n/a

eslint version

n/a

node version

n/a

@KATT KATT added the bug label Dec 12, 2023
@ljharb
Copy link
Member

ljharb commented Dec 12, 2023

Looks like it was added in docs here, and to the rule in #160.

@danreeves
Copy link
Contributor

While working on #3826 I came to the conclusion that this option never existed for the no-unstable-component-prop-pattern and was added to the documentation as a mistake: #3826 (comment)

I suggest re-labelling this issue as a bug, the fix being removing the incorrect documentation.

The original request in the linked tweet should be resolved by my PR.

The customValidators option for the prop-types/no-unused-prop-types rules is under-documented but I wouldn't consider fixing that a priority because prop-types are deprecated and removed in React 19

@ljharb
Copy link
Member

ljharb commented Sep 17, 2024

It's still a priority, and React 19 isn't even out yet.

I think the best approach is to actually implement the option.

@danreeves
Copy link
Contributor

That's fair. Improving the docs for where the option exists is doable.

I think it's not really clear what the option would do for no-unstable-component-prop-pattern. customValidators in prop-types/no-unused-prop-types is for specifying alternative validator objects to PropTypes. That doesn't really apply here. I suppose it could be used for the feature in my PR but the two different meanings could be confusing.

@ljharb
Copy link
Member

ljharb commented Sep 18, 2024

hm, yeah that’s also true.

I’m not sure if there’s a way to update the tooling to keep the option undocumented (cc @bmish)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants