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

refactor: Improve typescript types and strictness #367

Merged
merged 9 commits into from
Oct 30, 2024

Conversation

scagood
Copy link

@scagood scagood commented Oct 21, 2024

This adds a much stricter tsconfig.

It looks like this does now correctly export the types too.
image

@scagood
Copy link
Author

scagood commented Oct 21, 2024

I do still need to work on the type tests, I may see if I can steal from #366 😅

@scagood

This comment was marked as resolved.

@scagood scagood marked this pull request as ready for review October 21, 2024 21:18
lib/index.js Outdated Show resolved Hide resolved
@scagood scagood requested a review from voxpelli October 24, 2024 10:18
@aladdin-add aladdin-add changed the title ci: Attempt to get typescript happy refactor: Attempt to get typescript happy Oct 25, 2024
@scagood scagood changed the title refactor: Attempt to get typescript happy refactor: Improve typescript types and strictness Oct 25, 2024
Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM. confirmed the generated typings is right. 👍

@aladdin-add
Copy link

technically it fixes #320.

Did you not close it for the subsequent task of adding type tests? 😄

@scagood scagood linked an issue Oct 28, 2024 that may be closed by this pull request
@aladdin-add
Copy link

aladdin-add commented Oct 28, 2024

@voxpelli, @MichaelDeBoey, PTAL. :)

@aladdin-add aladdin-add merged commit 18cdd53 into eslint-community:master Oct 30, 2024
29 checks passed
Copy link
Member

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

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

This makes me think that we should port the codebase to pure TS at one point in the (near) future 🤔

CC/ @eslint-community/eslint-plugin-node

@scagood scagood deleted the typescript-war branch October 30, 2024 13:32
@scagood
Copy link
Author

scagood commented Oct 30, 2024

This makes me think that we should port the codebase to pure TS at one point in the (near) future 🤔

I am currently in the jsdoc > typescript camp for a few reasons:

  1. Any transform causes more problems in the future than they solve now
  2. I prefer adding documentation lines to functions, meaning I have to make a jsdoc block anyway
  3. The allowJs flag means that we can use all of typescript's typing benefits without the transpilation step.

Its not that I am not against using typescript, I just find that I prefer jsdoc 🤔

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.

🩹 Typescript 5.5 generated types dont include typedef
4 participants