marko-js / marko-js/language-server

Scoped `<style/name>` tag variable is typed `never`

Open
#581 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
44
Forks
12
Avg merge
1h 56m
Merged PRs (30d)
7

Description

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; }
  --

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Marko snippets with npx mtc and inspect the language-server handling for <style/name> bindings. Compare the inferred type for styles.foo with the destructuring example and the missing control case. Done means valid CSS names no longer produce TS2339 while unknown names still error.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.