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

Allow return `symbol` in `getPropertyName`

Open fisker opened this issue 4 years ago • 1 comments

Currently getPropertyName always return string (bigint is also possible when it's Literal), but property can be a symbol

bar[Symbol.iterator]()

This can be calculated by getStaticValue.

BTW: Similar bug in ESLint core, this will cause foo["Symbol()"] foo[Symbol()] considered as same reference.

I think it should return string | symbol or just return the value as it is, let user convert to string.

fisker avatar May 12 '21 09:05 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