File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ export default defineConfig(
3131 "@typescript-eslint/no-empty-function" : 0 ,
3232 "prefer-template" : 2 ,
3333 "@typescript-eslint/consistent-type-imports" : 2 ,
34+ "no-restricted-syntax" : [
35+ "error" ,
36+ {
37+ selector : "CallExpression[callee.property.name='bind']" ,
38+ message :
39+ "Prefer arrow functions over invoking Function.prototype.bind" ,
40+ } ,
41+ ] ,
3442 } ,
3543 } ,
3644 {
Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ export default class Action<
125125 this . #actionCallback = actionCallback ;
126126 this . #cancelCallback = cancelCallback ;
127127 this . ros . on ( this . name , ( msg ) => {
128- if ( isRosbridgeSendActionGoalMessage ( msg ) ) {
129- this . #executeAction. bind ( this ) ;
128+ if ( isRosbridgeSendActionGoalMessage < TGoal > ( msg ) ) {
129+ this . #executeAction( msg ) ;
130130 } else {
131131 throw new Error (
132132 "Received unrelated message on Action server event stream!" ,
Original file line number Diff line number Diff line change @@ -260,9 +260,9 @@ export interface RosbridgeSendActionGoalMessage<TArgs = unknown>
260260 compression ?: string ;
261261}
262262
263- export function isRosbridgeSendActionGoalMessage (
263+ export function isRosbridgeSendActionGoalMessage < TArgs = unknown > (
264264 message : RosbridgeMessageBase ,
265- ) : message is RosbridgeSendActionGoalMessage {
265+ ) : message is RosbridgeSendActionGoalMessage < TArgs > {
266266 return message . op === "send_action_goal" ;
267267}
268268
You can’t perform that action at this time.
0 commit comments