Bug: [prefer-literal-enum-member] allowBitwiseExpressions with self-referential enums does not disable error #7763
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.2.2&fileType=.ts&code=PTAEDMCcHsFtQBYBckAcDOAuEB3PA6JAT1QFN0BjSAS1SQBsBDAOwHN9pJXgATaC9MAQseAI2jQA1sFLMArrHT5ksegChZC0ADFq9UgEEKFculABvNaFAA5aM1IAaK6ABKpRj1ABeUAEZQAB5A-2drAHUaJFIffyCQgCYwtw8eSOpo2PdPUAAfUHTo5wBfIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0Wlsfy8AhvHpNYAW1oTEEgEa90YANpRe0APbRIAGkxQR8DQHcAQpXzHKyRAFEAHhxTJKGpqgz44iMAF8wALrgfiC%2BQA&tsconfig=&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
There should be no reported error. This is a fairly normal use-case for enums and bitwise operators. The official ts docs even have it as an example.
I would like a way to only allow literal enums, but also allow bitwise in this use case. I can get the code to pass by changing it to, but I feel it makes things less clear:
Actual Result
Recieve error:
Additional Info
In the actual code I an writing, I am extending "plugin:@typescript-eslint/strict-type-checked"
The text was updated successfully, but these errors were encountered: