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

[New] forbid-dom-props: Add disallowedValues option for forbidden props #3877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makxca
Copy link

@makxca makxca commented Jan 11, 2025

Add disallowedValues for disallowing only certain values for certain props

Discussion: #3876

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.66%. Comparing base (efc021f) to head (a2e9dac).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3877      +/-   ##
==========================================
+ Coverage   97.64%   97.66%   +0.02%     
==========================================
  Files         133      136       +3     
  Lines        9966     9986      +20     
  Branches     3703     3706       +3     
==========================================
+ Hits         9731     9753      +22     
+ Misses        235      233       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ljharb ljharb marked this pull request as draft January 12, 2025 00:27
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a regex is a nonstarter; see #3876 (comment)

Each array element can either be a string with the property name or object specifying the property name, an optional
custom message, and a DOM nodes disallowed list (e.g. `<div />`):
custom message, DOM nodes disallowed list (e.g. `<div />`) and a list of prohibited values:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
custom message, DOM nodes disallowed list (e.g. `<div />`) and a list of prohibited values:
custom message, DOM nodes disallowed list (e.g. `<div />`), and a list of prohibited values:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed it, but in a wrong place

@makxca makxca force-pushed the master branch 2 times, most recently from a7911e2 to d52c0f1 Compare January 12, 2025 21:53
@makxca makxca marked this pull request as ready for review January 12, 2025 21:53
@makxca makxca force-pushed the master branch 2 times, most recently from de2e1ea to 5d3d27c Compare January 13, 2025 07:30
@makxca makxca changed the title [New] forbid-dom-props: Add valueRegex option for forbidden props [New] forbid-dom-props: Add disallowedValues option for forbidden props Jan 13, 2025
@makxca makxca requested a review from ljharb January 13, 2025 19:44
@makxca
Copy link
Author

makxca commented Jan 13, 2025

I changed valueRegex to disallowedValues and fixed the comma in the docs

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

Successfully merging this pull request may close these issues.

2 participants