Skip to content

Commit ab75c78

Browse files
committed
Ban function binding
1 parent 2011f1d commit ab75c78

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

eslint.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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
{

src/core/Action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default class Action<
128128
this.#cancelCallback = cancelCallback;
129129
this.ros.on(this.name, (msg) => {
130130
if (isRosbridgeSendActionGoalMessage(msg)) {
131-
this.#executeAction.bind(this);
131+
this.#executeAction(msg);
132132
} else {
133133
throw new Error(
134134
"Received unrelated message on Action server event stream!",

0 commit comments

Comments
 (0)