eslint-utils icon indicating copy to clipboard operation
eslint-utils copied to clipboard

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

Open fisker opened this issue 4 years ago • 1 comments

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.

fisker avatar Jan 18 '21 02:01 fisker

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

MichaelDeBoey avatar Oct 14 '23 16:10 MichaelDeBoey