Skip to content

Commit d0e4fd9

Browse files
committed
Enable noImplicitAny
1 parent 5d7ba93 commit d0e4fd9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/core/Ros.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import type {
3333
} from "./transport/Transport.js";
3434
import { WebSocketTransportFactory } from "./transport/WebSocketTransportFactory.ts";
3535

36+
interface TypeDefDict {
37+
[key: string]: string | string[] | TypeDefDict | TypeDefDict[];
38+
}
39+
3640
/**
3741
* Manages connection to the rosbridge server and all interactions with ROS.
3842
*
@@ -641,7 +645,7 @@ export default class Ros extends EventEmitter<
641645
hints: rosapi.TypeDef[],
642646
) => {
643647
// calls itself recursively to resolve type definition using hints.
644-
const typeDefDict = {};
648+
const typeDefDict: TypeDefDict = {};
645649
for (let i = 0; i < theType.fieldnames.length; i++) {
646650
const arrayLen = theType.fieldarraylen[i];
647651
const fieldName = theType.fieldnames[i];

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
/* Rules to be enabled */
5555
"exactOptionalPropertyTypes": false /* Differentiate between undefined and not present when type checking */,
56-
"noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
56+
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
5757

5858
"types": ["@types/node"]
5959
},

0 commit comments

Comments
 (0)