Skip to content

Conversation

@imkesin
Copy link
Contributor

@imkesin imkesin commented Jan 17, 2025

Task

Use npm run typecheck or npx tsc --noEmit to figure out where there are type errors in the repo.

A significant chunk of them are related to noUncheckedIndexAccess.

I encourage you to use type guards when possible:

type ArrayWithAtLeastTwo<T> = readonly [T, T, ...T[]]

export function isArrayWithAtLeastTwo<T>(list: ReadonlyArray<T>): list is ArrayWithAtLeastTwo<T> {
  return list.length >= 2
}

This commit is not intended to be final - there are many errors to be cleaned-up
Comment on lines +11 to +13
// Uncomment and resolve ASAP
// "isolatedModules": true,
// "verbatimModuleSyntax": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two need to be addressed in a follow-on PR.

They mostly related to the usage of import type syntax.

@imkesin
Copy link
Contributor Author

imkesin commented May 21, 2025

This has been superceded by #625

@imkesin imkesin closed this May 21, 2025
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