-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
code qualityImprovements to code qualityImprovements to code quality
Description
Defined in BaseTarget.
cursorless/src/processTargets/targets/BaseTarget.ts
Lines 116 to 123 in 8639b56
| readonly cloneWith = (parameters: CloneWithParameters) => { | |
| const constructor = Object.getPrototypeOf(this).constructor; | |
| return new constructor({ | |
| ...this.getCloneParameters(), | |
| ...parameters, | |
| }); | |
| }; |
It uses any, so programmer can forget clone parameters without Typescript detecting it. Possible solutions:
- Enable
explicit-function-return-typeto force programmer to strongly type their clone parameters - Move implementation to derived types, maybe with a utility function that they can use?
- Figure out a way to make it strongly typed in the base class?
Metadata
Metadata
Assignees
Labels
code qualityImprovements to code qualityImprovements to code quality