Proposal: strictJsxAttributeChecks #46229
Labels
Effort: Casual
Good issue if you're already used to contributing to the codebase. Harder than "good first issue".
Experimentation Needed
Someone needs to try this out to see what happens
Help Wanted
You can do this
Suggestion
An idea for TypeScript
When TypeScript checks if provided attributes match a given type, it exempts dashed attributes from being checked against things like index signatures.
This applies to all index signatures, even string pattern index signatures that match.
Under this new
--strict
mode flag, these properties would be strictly checked in the presence of an index signature.This issue is a possible alternative for #44797. Instead of validating against a specific set of index signatures, this idea in this proposal is to tighten checking against all index signatures under a new strict-mode flag.
✅ Viability Checklist
My suggestion meets these guidelines:
--strict
mode users.💻 Use Cases
One of the motivating examples for template string types was index patterns on object types. This was something that specifically came up in discussions with library authors of Fluent UI; however, this checking doesn't fully apply to JSX attributes, which seems like an unfortunate accident.
The text was updated successfully, but these errors were encountered: