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

Improve type inference from AST #74

Open alexprey opened 3 years ago

alexprey commented 3 years ago

In the following PR https://github.com/alexprey/sveltedoc-parser/pull/71 we introduce improvement for variable type inference, but it is not support more complex cases. For example, all arrays are not generic and all functions don't have specification.

input:

const output = [1, 2, 3];

expected output:

type: "Array<number>"