Bug: [no-inferrable-types] False negative for parameter properties #7278
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
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.1.6&fileType=.tsx&code=MYGwhgzhAECyCeAVAphALtA3gKGtYA9gHboBOArsGgaQBS57QBmBBAXNEeQLYBGypaAF5oAZgA0jKXgD0M6ANI1JkBQA8ADsirIAJgzwbyvEAEtg0XmFIcufAcLGToczgQWklpBgEosB6AA3AlNdZlZJK1IAbgYAX2wEoA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1uYDNFpoAQwBGSWkVKoMkftA7RI4MAF8QyoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eFYDAruuGAL4g9A&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
An error from
@typescript-eslint/no-inferrable-types
should appear for both parameters (both parameters include a type declaration for a trivially inferrable type).Actual Result
An error from
@typescript-eslint/no-inferrable-types
appears for the standard parameter but not for the parameter written as a parameter property.Additional Info
This issue appears with the default rule settings, i.e.
This behavior might be considered expected when ignoreParameters and/or ignoreProperties is set to true (although how that behavior would be defined is a little murky, given that parameter properties are parameters and properties).
The text was updated successfully, but these errors were encountered: