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

Add noUncheckedIndexedAccess to tsconfig #277

Open
mattrunyon opened this issue Nov 4, 2021 · 1 comment
Open

Add noUncheckedIndexedAccess to tsconfig #277

mattrunyon opened this issue Nov 4, 2021 · 1 comment

Comments

@mattrunyon
Copy link
Collaborator

microsoft/TypeScript#13778

The issue above explains in detail, but basically without this rule enabled, TypeScript does not complain when a value is possibly undefined because it is accessed via indexing such as myArr[i] or myObj[someStrVar]

We should enable this to better catch any potential errors caused by uncaught undefined values

@mattrunyon mattrunyon added enhancement New feature or request triage Issue requires triage labels Nov 4, 2021
@mofojed mofojed added this to the December 2021 milestone Nov 24, 2021
@mofojed mofojed removed the triage Issue requires triage label Nov 24, 2021
@mofojed mofojed modified the milestones: December 2021, January 2022 Jan 11, 2022
@mattrunyon mattrunyon self-assigned this Jan 11, 2022
@mattrunyon mattrunyon added internal typescript and removed enhancement New feature or request labels Jan 11, 2022
@mattrunyon
Copy link
Collaborator Author

This rule actually might be more hassle than it's worth. It also adds index checks inside for loops which could get quite annoying. Enabling the rule introduces 167 errors (there are multiple errors fixed by a single check, but still annoying)

@mofojed mofojed modified the milestones: January 2022, Backlog Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants