Rule proposal: Detect useless default in function parameters and object destructuring #6106
Open
6 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: new plugin rule
New rule request for eslint-plugin
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Description
Default parameters and default values are only used if the parameter or property is
undefined
(either because its value isundefined
or because it is missing). So if we know that a function parameter or property can never beundefined
, then we also know that the default is never actually used. This can be used to detect useless defaults.Fail Cases
Pass Cases
Additional Info
This rule requires strict null checks to be enabled.
The text was updated successfully, but these errors were encountered: