regexFind: /\[(\.\.\.\w+)\s*:\s*\w+\]/
regexReplace: [key: string]Remove rest parameter from index signature. Index signatures can only have a single parameter.
- interface MyInterface {
- [...rest: any]: any
- }
+ interface MyInterface {
+ [key: string]: any
+ }Explanation: Index signatures cannot use rest parameters, use standard parameter syntax
- interface DataInterface {
- [...args: unknown]: unknown
- }
+ interface DataInterface {
+ [key: string]: unknown
+ }Explanation: Replace rest parameter with standard index signature parameter
npx tsc ./docs/1017/index.ts --noEmit --prettydocs/1017/index.ts:2:4 - error TS1017: An index signature cannot have a rest parameter.
2 [...rest: any]: any
~~~OR (without --pretty flag):
docs/1017/index.ts(2,4): error TS1017: An index signature cannot have a rest parameter.