Bug: [dot-notation] Conflict between noPropertyAccessFromIndexSignature
and extra (constrained) object keys
#10627
Closed
4 tasks done
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.7.2&fileType=.ts&code=C4TwDgpgBAogHsATgQwNIRFAvFABhBFAEgG8BnJASwDsBzAX1wG4AoF0SKAZSQFcBjYL0QQA6pWAALeEmRlsUEiyhQAZgHt1ALigVENWqxUAjZIh3HNAGwjJqRqAG0Cs9CB0yUbgLo7qvAFtjCERWejZ%2BdWoKXT5BYTEJaUI5HR5EASERcSlPOQUlFQ1tKAAiSQgrK3VSgBplKFNzNWQrMgh6lRcUAEFjfh0AFgAmTqhu5AARCFUh0ZZwlkjo9RsAOmraAAo9TISc5NkyNeKASiWoslWIDfVt3fjspLzjpvOLlfXNnbisxNyUscJn1%2BOdllcvncfhlHv9DiggSlpqp3uDrrd7r99s9AY5SsD%2BqVvGDLujvg8-gcXniJsiiacgA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AEwHs6nuBDfJU5N0URNGidokcGAC%2BIOUA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkRsACprIlngJ4CC006JJAMWbwAkkQAm6AB4BlZAHMiAQzwBXTOgpg8mVenBgAviENA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
I expected
structureWithExtras["extraAbc"]
to not produce["extraAbc"] is better written in dot notation
Actual Result
structureWithExtras.extraAbc
is not liked bytsc
structureWithExtras["extraAbc"]
is not liked by@typescript-eslint/dot-notation
Additional Info
Just using
Record<ExtraKey, number>
produces the same deadlock (Playground):Replacing
Record<ExtraKey, number>
withRecord<string, number>
helps (Playground):However, using
Record<string, number>
would not be possible in the original example wherenumber
value is used alongsidestring
andboolean
.The text was updated successfully, but these errors were encountered: