Skip to content

Conversation

mvarchdev
Copy link

Update the return type of the findExpectedIndex function to include foundIndex and tagLineCount. Adjust the logic in the calling function to utilize the new return structure, ensuring proper handling of expected indices and offsets.

Fixes #1530

@brettz9
Copy link
Collaborator

brettz9 commented Sep 18, 2025

Great to have a fix. Can you also add tests in /test/rules/assertions/require-param.js?

You can test locally, e.g., with pnpm test-index --rule=require-param --invalid=-1

@mvarchdev
Copy link
Author

@brettz9 i pushed the tests

@brettz9 brettz9 force-pushed the bugfix/#1530-fix-duplicate-parameter-and-malforming-jsdoc branch from bb71eee to ee1c33d Compare September 21, 2025 18:21
@brettz9
Copy link
Collaborator

brettz9 commented Sep 21, 2025

Glad to see this... However, it seems that the test passes even before your changes. Can you add a minimal case which used to fail but no longer does?

@brettz9
Copy link
Collaborator

brettz9 commented Sep 21, 2025

Also, I don't know if your fix can improve this, but as per #540 , we have a couple other require-param issues, with some line numbers deliberately missing from tests because the currently output line numbers would be wrong. It would be great to fix these too if it makes sense for this PR.

@brettz9 brettz9 force-pushed the bugfix/#1530-fix-duplicate-parameter-and-malforming-jsdoc branch 2 times, most recently from ad95f72 to 39ba9c8 Compare September 24, 2025 07:50
@brettz9 brettz9 force-pushed the bugfix/#1530-fix-duplicate-parameter-and-malforming-jsdoc branch from 39ba9c8 to e0fac9f Compare September 25, 2025 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require-param fixer inserts new tags inside preceding @example blocks
2 participants