Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
{"rules": {"@typescript-eslint/<rule>": ["prefer-reduce-type-parameter"] }}
// first caseexportfunctionnormalizeParams<P>(params:P):P{returnObject.entries(params).reduce((acc,[key,value])=>{value=typeofvalue==='string' ?value.trim() :value;if(value){acc[keyaskeyofP]=value;}returnacc;},{}asP);}// second caseexporttypeKeys<T>={[KeyinkeyofT]:Key};exportconsttoKeys=<T>(source:T):Keys<T>=>Object.keys(source).reduce((acc,k)=>{constkey=kaskeyofT;acc[key]=key;returnacc;},{}asKeys<T>);
Expected Result
Ignore such cases
Actual Result
Error reporting
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 4.24.0 |
@typescript-eslint/parser | 4.24.0 |
TypeScript | 4.2.4 |
ESLint | 7.27.9 |
node | 12.22.1 |