Bug: [prefer-as-const] Rule doesn't support class properties #5405
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
good first issue
Good for newcomers
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=4.7.4&sourceType=module&code=MYGwhgzhAEAKCWAvRZoG8BQ1oAdIBcwAuaAcjwkNOgF4yKqBuDAXyA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0WloENktMgHsmyfOii9oI6JHBgAviCVA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA
Repro Code
ESLint Config
tsconfig
Expected Result
Expect an error and a suggestion to use
as const
instead of explicit type.Actual Result
No error.
Additional Info
No response
Versions
@typescript-eslint/eslint-plugin
5.31.0
@typescript-eslint/parser
X.Y.Z
TypeScript
4.7.4
ESLint
8.15.0
node
X.Y.Z
The text was updated successfully, but these errors were encountered: