alexprey / sveltedoc-parser

Generate a JSON documentation for a Svelte (https://github.com/sveltejs/svelte) component
https://www.npmjs.com/package/sveltedoc-parser
MIT License
90 stars 7 forks source link

Specifier comments are not parsed properly #67

Closed ekhaled closed 3 years ago

ekhaled commented 3 years ago
<script>
    /* The `a` variable description */
    let a = 1;
    /* The `b` variable description */
    let b = 'Test';
    /* The `c` variable description */
    let c = 'TestC';

    export { a, b, c };
</script>

Results in:


{
 //...
 "data":[
   {
      //...
      "description": "The `b` variable description",
      "name": "a",
      "kind": "let",
      //...
   },
   {
      //...
      "description": "The `c` variable description",
      "name": "b",
      "kind": "let",
      //...
   },
   {
      //...
      "description": "The `c` variable description",
      "name": "c",
      "kind": "let",
      //...
   },
 ]
}
alexprey commented 3 years ago

Hi @ekhaled! Thanks for bug finding and fixing that!

ekhaled commented 3 years ago

@alexprey please dont a make a release yet.. there are a couple of other edge cases like this I would like to fix first

alexprey commented 3 years ago

@ekhaled ok, no problem. It will be nice if you can also add unit tests for all thoose edge cases. Thoose can be useful in the feture when I'm done with typescript support.

ekhaled commented 3 years ago

@alexprey yes, will add unit tests for all the fixes