eslint-utils
eslint-utils copied to clipboard
Allow return `symbol` in `getPropertyName`
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.
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