Skip to content

Scoped <style/name> tag variable is typed never #581

Description

@briancarbone

Version

2.6.7

Description

<style/styles> types styles as never, so every styles.foo is a TS2339. Binding the same block with a destructuring pattern gets the correct type. Concise and HTML syntax behave the same.

Reproduction

Each is a single tag, checked with npx mtc.

// FAILS: Property 'thing' does not exist on type 'never'.
div class=styles.thing
style/styles --
  .thing { color: red; }
  --
// PASSES
div class=thing
style/{ thing } --
  .thing { color: red; }
  --
// FAILS, same error — so it isn't a concise-syntax issue
<div class=styles.thing/>
<style/styles>
  .thing { color: red; }
</style>
// Control: correctly errors, `missing` is not in the CSS
div class=missing
style/{ missing } --
  .thing { color: red; }
  --

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions