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/consistent-indexed-object-style": ["error","index-signature"] }}
typeNavbarItems=Record<string,// lazy-load the component()=>(props:any)=>JSX.Element>;typeNavbarItems=Record<Exclude<"a"|"b"|"c","a">,string>;
Expected Result
I expect the first to be fixed with comment preserved, and the second to be fixed to valid code:
// lazy-load the componenttypeNavbarItems={[key:string]:()=>(props:any)=>JSX.Element};typeNavbarItems={[keyinExclude<"a"|"b"|"c","a">]:string};
Actual Result
// This has the comment swallowedtypeNavbarItems={[key:string]:()=>(props:any)=>JSX.Element};// This should use mapped type instead of index signaturetypeNavbarItems={[key:Exclude<"a"|"b"|"c","a">]:string};
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 5.16.0 |
@typescript-eslint/parser | 5.16.0 |
TypeScript | 4.6.3 |
ESLint | 8.11.0 |
node | 17.5.0 |