Skip to content

refactor: Improve typescript types and strictness#367

Merged
aladdin-add merged 9 commits intoeslint-community:masterfrom
scagood:typescript-war
Oct 30, 2024
Merged

refactor: Improve typescript types and strictness#367
aladdin-add merged 9 commits intoeslint-community:masterfrom
scagood:typescript-war

Conversation

@scagood
Copy link
Copy Markdown

@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
Copy Markdown
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
Comment thread lib/unsupported-features/node-globals.js
Comment thread lib/index.js
@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
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

aladdin-add commented Oct 28, 2024

@voxpelli, @MichaelDeBoey, PTAL. :)

@aladdin-add aladdin-add merged commit 18cdd53 into eslint-community:master Oct 30, 2024
Copy link
Copy Markdown
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
Copy Markdown
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