Scoped `<style/name>` tag variable is typed `never`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- css, typescript
- Domain
- developer-experience, tooling
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.
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; }
--
- Dominant language
- TypeScript
- Stars
- 44
- Forks
- 12
- Avg merge
- 1h 56m
- Merged PRs (30d)
- 7
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
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.
More from marko-js/language-server
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
marko-js/language-server#596 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
marko-js/language-server#587 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
marko-js/language-server#240 · 2 comments ·
All issues in marko-js/language-server
Similar issues
-
resources
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
railmapgen/rmg-palette#2445 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
danielmiessler/LifeOS#2242 ·
Maintainers usually reply within 5 days
-
good first issue hacktoberfest help wanted translation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/appduct#129 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100