-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
licensePattern
configuration accepts any string if pattern match fails
#885
Comments
licensePattern
configuration accepts any string if pattern match fails
Yes, this change was made by design as part of #884. (The previous behavior had not been documented as such, so I tweaked it to allow for the regex to allow for opting out.) The match now is intended to capture the area to be validated, so if you want to ensure that missing license patterns are caught, you should design your regex to eagerly match content (e.g., by use of Closing as that should address though feel free to comment further as needed. |
@brettz9 Thanks for the response. Scenario 2: |
The regex is just to find the zone which ought to identify any string area to be checked. If a zone is not found, then it is treated as valid. |
How do we enforce a particular string pattern to be present in the license block? |
You should I think be able to use |
I believe that is for the Feedback: The current implementation of The match-description also gives a great example of how the error message is shown when the pattern match fails. |
Regarding the feedback, we can add more descriptive text in the docs, but I believe we need some way to define a zone such that missing matches can pass validation. |
Scenario 1 (Works as expected)
No
licensePattern
- Shows errorScenario 2 (Not working as expected)
With licensePattern - Shows no error
Environment
eslint-plugin-jsdoc
version: 39.2.9The text was updated successfully, but these errors were encountered: