Skip to content

Increase type strictness to prepare for Typescript 6 - #367

Merged
demiankatz merged 23 commits into
FalveyLibraryTechnology:devfrom
Jason-Benson:typescript6_update
Aug 3, 2026
Merged

Increase type strictness to prepare for Typescript 6#367
demiankatz merged 23 commits into
FalveyLibraryTechnology:devfrom
Jason-Benson:typescript6_update

Conversation

@Jason-Benson

Copy link
Copy Markdown
Contributor

This is the first in a set of updates to allow typescript 6.
One notable change from TS5 is that strict is now implicit, and I updated tsconfig to match previous behavior. A lot more work is needed before ts6 can be used.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @Jason-Benson! I didn't have time to review this very thoroughly, but I have a few questions and comments below that might be helpful.

There is already quite a lot going on in this PR -- I'd suggest if you do any more, start separate PRs so we can discuss separate issues in separate places, and get things merged as they are finished. Otherwise, this will become hard to keep track of! (I realize it's a balancing act, because if you split things up into too many separate branches, that can lead to merge conflicts and other problems... but I think in this case there's a lot of potential for working in smaller chunks without running into that kind of trouble).

Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/package.json Outdated
Comment thread api/src/models/ImageFile.ts

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the progress. See below for one new comment based on a re-review of changed files. Also note that the PR is reporting conflicts in package.json, so there's definitely a need to do a merge of upstream/dev -- if it's giving you trouble, let me know and I'll help!

Comment thread api/src/models/Config.ts Outdated

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the progress here, @Jason-Benson! There's still some rearrangement needed in Config.ts -- see below for lots of comments on that subject, plus one other unrelated thing.

I haven't done any hands-on testing yet, and there are still a couple more files I need to look at, but I think we're getting pretty close to the end of this if nothing is actually broken. :-)

Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Job.ts Outdated

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the progress, @Jason-Benson. Looks like you've made good progress, but there are still a few unresolved comments. Do you need help with anything, or still just chipping away?

@@ -0,0 +1,15 @@
// Work around for a flaw in @types/pdfkit, which omits `openImage()` from the type definitions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this is definitely an easier-to-understand version of the fix, and a reasonable solution while we wait for an upstream fix.

If we're impatient for an upstream fix, I wonder if we should try submitting a PR against https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pdfkit/index.d.ts -- it appears that this repository is fairly active and people have been pushing changes to the pdfkit definitions relatively recently, so more fixes may be accepted.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @Jason-Benson, I gave this another thorough review and looked at all of the remaining files. Everything looks good except some more nitpicky type things in the config class. See below for a bunch of suggestions, but please note that none of them are tested, so it's possible I have made mistakes. Please double-check my work! Also note that I spotted one issue in existing code and made note of it in a comment, so watch for that one. :-)

Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for all the progress, @Jason-Benson. It looks like two of my last round of comments have not been resolved yet, and that may be because my suggestions were bad (one of them DEFINITELY was), so I'm trying again to make better suggestions this time. ;-)

Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Three more little things!

Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated
Comment thread api/src/models/Config.ts Outdated

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One last little bit of cleanup...

Comment thread api/src/models/Config.ts Outdated
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
@demiankatz demiankatz changed the title Typescript6 update Increase type strictness to prepare for Typescript 6 Aug 3, 2026

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything is looking good and working for me now. Thanks, @Jason-Benson!

@demiankatz
demiankatz merged commit a924b92 into FalveyLibraryTechnology:dev Aug 3, 2026
1 check passed
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.

2 participants