Always move component documentation comment to the top
See original GitHub issueYou can create documentation for a Svelte component like this. I think it makes sense to always have this at the top of the file.
Current result when using scripts-markup-style
:
<script>
export let name = 'world';
</script>
<!--
@component
Here's some documentation for this component.
It will show up on hover.
-->
<h1>Hello, {name}</h1>
<style>
h1 {
color: blue;
}
</style>
Desired result:
<!--
@component
Here's some documentation for this component.
It will show up on hover.
-->
<script>
export let name = 'world';
</script>
<h1>Hello, {name}</h1>
<style>
h1 {
color: blue;
}
</style>
This would be a breaking change.
Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to Write Doc Comments for the Javadoc Tool - Oracle
This document describes the style guide, tag and image conventions we use in documentation comments for Java programs written at Java Software, Oracle....
Read more >Best practices for writing code comments - Stack Overflow Blog
Best practices for writing code comments. While there are many resources to help programmers write better code—such as books and static ...
Read more >Document Commenting in Managed Projects_AD - Altium
Type your comment, then click the. button beneath. The comment will be committed, appearing in the panel. For point, area and component type ......
Read more >Scroll to the top of the page after render in react.js
Example code: class MyComponent extends React.Component { componentDidMount() { this._div.scrollTop = 0 } render() { return <div ref={(ref) => this.
Read more >Positioning - Learn web development | MDN
Positioning allows us to produce interesting results by overriding normal document flow. What if you want to slightly alter the position of some ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, right, true. We’d need to extend that to work with arbitrary comments then essentially. Looking at the code, that would also make sense code-wise. Seems like it should be a simple change.
I think I like this change though I’ve never used this component documentation, so take that with a grain of salt. We should probably update the faq question you linked to if this change is made to use the same style.