marko-js / marko-js/language-server
Scoped `<style/name>` tag variable is typed `never`
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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