close
Skip to content

Add eslint support for semver validation and optional description to @since tag#70734

Open
USERSATOSHI wants to merge 1 commit intoWordPress:trunkfrom
USERSATOSHI:try/relax-at-since-eslint-rule
Open

Add eslint support for semver validation and optional description to @since tag#70734
USERSATOSHI wants to merge 1 commit intoWordPress:trunkfrom
USERSATOSHI:try/relax-at-since-eslint-rule

Conversation

@USERSATOSHI
Copy link
Copy Markdown
Contributor

What?

Closes #20859

This PR adds supports for adding semver validation and optional description for @since tag in JSDoc

Why?

While #20427 ( increasing severity of eslint-plugin-jsdoc ) was being worked on, It was found that, It flagged description/explanation after the version in @since which is a frequently-used pattern in WordPress projects.

Due to this, jsdoc/check-values was disabled to prevent errors but this leads to manually checking versions in @since.

This PR adds supports for semver validation on @since while also adding support for optional description.

How?

This PR adds a custom @wordpress/require-valid-since ( name can be changed ) which checks for proper semver versions in @since tag while also allowing optional description.

Testing Instructions

Added Unit Tests should suffice for testing

Screenshots or screencast

image image

@USERSATOSHI USERSATOSHI changed the title feat(eslint): add custom rule for optional desc in @since jsdoc Add eslint support for semver validation and optional description to @since tag Jul 15, 2025
@USERSATOSHI USERSATOSHI marked this pull request as ready for review July 15, 2025 15:27
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @sainthkh.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: sainthkh.

Co-authored-by: USERSATOSHI <tusharbharti@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Tool] ESLint plugin /packages/eslint-plugin labels Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] ESLint plugin /packages/eslint-plugin [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESLint plugin: Relax the rule for @since in JSDoc

2 participants