Skip to content

Enable noImplicitAny in tsconfig.json#684

Merged
truggeri merged 3 commits into
mainfrom
tsconfig-enable-no-implicit-any
Mar 26, 2026
Merged

Enable noImplicitAny in tsconfig.json#684
truggeri merged 3 commits into
mainfrom
tsconfig-enable-no-implicit-any

Conversation

@jeffwidman

@jeffwidman jeffwidman commented Mar 26, 2026

Copy link
Copy Markdown
Member

Stacked on #685.

Removes the noImplicitAny: false override so strict: true applies fully.

Changes

  • tsconfig.json: Remove noImplicitAny: false
  • src/dependabot/update_metadata.ts: Add explicit any type to dependency and number type to index in callback params
  • src/dependabot/verified_commits.ts: Add explicit any type to a in .find() callback
  • src/dry-run.ts: Add string types to name, version, directory params; add Argv type to yargs builder callback
  • package.json: Add @types/pluralize dev dependency (the pluralize package has no built-in types)

Note on any types

Some parameters are typed as explicit any rather than stricter interfaces. These values come from external sources (YAML-parsed commit metadata and GraphQL responses) where the shape isn't enforced at compile time. Using explicit any keeps the scope of this PR focused on enabling noImplicitAny — stricter types for these external data sources can be added separately.

tsc --noEmit clean. All 49 tests pass.

Add a "typecheck" script (tsc --noEmit) to package.json and run it
in CI before lint and test. This catches TypeScript type errors that
esbuild silently ignores during bundling.
Remove the noImplicitAny: false override so strict: true applies fully.
Add explicit type annotations to all callback parameters that were
relying on implicit any. Install @types/pluralize for the pluralize
package.
@jeffwidman jeffwidman force-pushed the tsconfig-enable-no-implicit-any branch from 9483b02 to d767f1c Compare March 26, 2026 05:26
@jeffwidman jeffwidman changed the base branch from main to ci-add-typecheck March 26, 2026 05:26
@jeffwidman jeffwidman marked this pull request as ready for review March 26, 2026 05:28
@jeffwidman jeffwidman requested a review from a team as a code owner March 26, 2026 05:28
Base automatically changed from ci-add-typecheck to main March 26, 2026 18:34

@truggeri truggeri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hate using any, but we can "clean" that up with a follow up, so let's merge this now.

@truggeri truggeri merged commit c5dc5b1 into main Mar 26, 2026
9 checks passed
@truggeri truggeri deleted the tsconfig-enable-no-implicit-any branch March 26, 2026 18:39
@jeffwidman

Copy link
Copy Markdown
Member Author

I feel the same, I investigated that as well last night, but the underlying data structures are coming from external libs and not really typed... we could add an interface, but i'm just hesitant to "mock what I don't own, especially if the library says it's a little bit fluid"

But you know a lot more than I do about the Javascript world, maybe that's more idiomatic there?

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