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

chore: Add feat/jsdoc-require-returns-type eslint rule #115

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Pathan-Amaankhan
Copy link
Member

@Pathan-Amaankhan Pathan-Amaankhan commented Mar 3, 2025

What

Related Issue(s):

Testing Instructions

  • Run npm install && npm run lint.

Additional Info

  • As this PR fixes the codebase, we won't be getting any eslint errors.

Checklist

  • I have read the Contribution Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint, tsc, prettier etc.).
  • My code has detailed inline documentation.
  • I have added unit tests to verify the code works as intended.
  • I have updated the project documentation as needed.
  • I have added a changeset for this PR using npm run changeset.

Copy link

changeset-bot bot commented Mar 3, 2025

⚠️ No Changeset found

Latest commit: e470423

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Pathan-Amaankhan Pathan-Amaankhan marked this pull request as ready for review March 3, 2025 16:49
@Pathan-Amaankhan Pathan-Amaankhan self-assigned this Mar 3, 2025
@justlevine justlevine requested a review from ayushnirwal March 3, 2025 20:14
justlevine
justlevine previously approved these changes Mar 3, 2025
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

I'm approving based on the CI passing.

I still think it's counterintuitive to be doing ESLint types before we fix/enforce our TS types 🤷

Pinging @ayushnirwal in case he has something to add.

@justlevine justlevine changed the title feat: Add feat/jsdoc-require-returns-type eslint rule chore: Add feat/jsdoc-require-returns-type eslint rule Mar 3, 2025
@justlevine
Copy link
Collaborator

(its a chore: because no production code has changed ).

@justlevine
Copy link
Collaborator

(better to enforce return types vs TS - on hold)

Copy link
Collaborator

@ayushnirwal ayushnirwal left a comment

Choose a reason for hiding this comment

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

Use require-returns to enforce descriptions. (as a warning)
Use explicit-function-return-type to enforce return types in TS (as an error)

@Pathan-Amaankhan
Copy link
Member Author

Pathan-Amaankhan commented Mar 11, 2025

Hi @ayushnirwal,
Have added @typescript-eslint/explicit-function-return-type eslint rule & fixed all the eslint issues.

cc: @justlevine

.eslintrc.cjs Outdated
@@ -71,6 +71,7 @@ module.exports = {

// Turn of JSdoc types and use TypeScript types instead.
'jsdoc/no-types': [ 'off' ],
'jsdoc/require-returns-type': [ 'warn' ],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'jsdoc/require-returns-type': [ 'warn' ],
'jsdoc/require-returns': [ 'warn' ],

Copy link
Member Author

Choose a reason for hiding this comment

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

@ayushnirwal So, should I also revert the types added to return?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, you can remove types from @returns tag in JSDOC

Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

No need for me to review this again. Once @ayushnirwal approves this and a changeset is added, lmk and I'll merge.

Copy link
Collaborator

@ayushnirwal ayushnirwal left a comment

Choose a reason for hiding this comment

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

This PR is mergable after this and merge conflicts are resolved. Also, changeset too.

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.

3 participants