eslint-utils
eslint-utils copied to clipboard
Feature request: A function to get the value type of node `getStaticType`
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.
Hi @fisker!
Since this repo is unmaintained, you might want to re-open this issue in the @eslint-community fork https://github.com/eslint-community/eslint-utils
For more info about why we created this organization, you can read https://eslint.org/blog/2023/03/announcing-eslint-community-org