Skip to content

Feature request: A function to get the value type of node getStaticType #17

@fisker

Description

@fisker

Similar to getStaticValue, but only tell the type.

For example

`a${foo}` -> string
[...foo] -> array
{foo} -> object
!foo -> boolean
...

It's useful to make some auto-fix, example

Enforce new Array(foo) to Array.from({length: foo}) or [foo], if we can know type of foo is number, we can auto fix to the first one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions