You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Poll: Name a compiler option for including undefined when a property resolves to an index signature #40435
The exact behavior that this flag would enable is, briefly:
Read expressions of the form expr[i] will now be T | undefined where T is the index signature type
Read expressions of the form expr.prop will now be T | undefined where T is the index signature type if an index signature on expr exists but not a declared property named prop
string and number index signatures are both subjected to this treatment
Write expressions expr[i] = v and expr.prop = v are unaffected
Type expressions TypeName[number] and TypeName["prop"] are unaffected
Good candidate flag names should follow these rules and goals:
Do not start with strict since this flag would not get turned on by the global --strict setting
I will seed this with some of the names suggested at our last meeting. We may also cull options that aren't receiving a lot of votes to help keep the comment count manageable.
Reacted by Jamie Kyle, Ankeet Maini, Ashley Claymore, Joshua Marantz, Kris Kaczor, Andrii Dieiev, John Reilly, Vincent Driessen, Igor Bezkrovnyi, Charles Toller and 7 more
Reacted by Brendan Forster, Ramana Venkata, Jordi Oliveras Rovira, David Neil, Joshua Marantz, Corey Woodfield, Geoff Maddox, AwesomeObserver, Georges Haidar, Jeremy Fischer and 65 more
--indexNullChecks (like --strictNullChecks but for index access)
Reacted by Esa-Matti Suuronen, Joe Percy, Salvatore, Luke John, ExE Boss, John Lenz, Nathan Shively-Sanders, John Boswell, Boris Serdiuk, electrovir and 3 more
Reacted by Ryan Cavanaugh, Simon Hessner, Oliver Joseph Ash, Salvatore, Mordy Tikotzky, Andreas, Jan Sydänviita, Matias Klemola, Joe Percy, David Sheldrick and 9 more
I think this one nails it, however I'd adjust it to --noUncheckedIndexAccess (uncheck-ed and index-ed it a feels a bit too much of -ed).
Reacted by Dan Mercer, brunnerh, Tim Deschryver, Oliver Joseph Ash, ExE Boss, James Bromwell, electrovir, Daniel Fischer, Daniel Levett, GuateDev IO and 6 more
Activity
RyanCavanaugh commentedon Sep 8, 2020
--pedanticIndexSignaturesRyanCavanaugh commentedon Sep 8, 2020
--noUncheckedIndexedAccessRyanCavanaugh commentedon Sep 8, 2020
--undefinedIndexSignaturesRyanCavanaugh commentedon Sep 8, 2020
--skepticalIndexAccessesRyanCavanaugh commentedon Sep 8, 2020
--noImplicitBoundsorta commentedon Sep 8, 2020
--rigorousIndexAccessdanvk commentedon Sep 8, 2020
--carefulIndexAccessjack-williams commentedon Sep 8, 2020
--partialIndexedAccessawinograd commentedon Sep 8, 2020
--maybeIndexAccessOliverJAsh commentedon Sep 8, 2020
--indexNullChecks(like--strictNullChecksbut for index access)kirillgroshkov commentedon Sep 8, 2020
--safeIndexAccessdanvk commentedon Sep 8, 2020
--soundIndexedAccesspatrickkunka commentedon Sep 8, 2020
--uncertainIndexAccessPersonally I feel the name should highlight the aspect of uncertainty introduced here, rather than the aspect of strictness.
thw0rted commentedon Sep 9, 2020
--includeUndefinedInIndexSignaturesthw0rted commentedon Sep 9, 2020
--includeUndefinedInIndexAccessalex-okrushko commentedon Sep 10, 2020
I think this one nails it, however I'd adjust it to
--noUncheckedIndexAccess(uncheck-ed and index-ed it a feels a bit too much of -ed).zeusdeux commentedon Sep 10, 2020
--checkIndexedAccessRyanCavanaugh commentedon Sep 12, 2020
We have a winner 🥇
johnnyreilly commentedon Sep 12, 2020
Are you rolling with
--noUncheckedIndexedAccessor Alex Okrushko (@alex-okrushko)'s suggested tweak of--noUncheckedIndexAccess?