Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/core/Ros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import type {
} from "./transport/Transport.js";
import { WebSocketTransportFactory } from "./transport/WebSocketTransportFactory.ts";

interface TypeDefDict {
[key: string]: string | string[] | TypeDefDict | TypeDefDict[];
}
Comment on lines +36 to +38
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

literally wtf is this type lmao


/**
* Manages connection to the rosbridge server and all interactions with ROS.
*
Expand Down Expand Up @@ -641,7 +645,7 @@ export default class Ros extends EventEmitter<
hints: rosapi.TypeDef[],
) => {
// calls itself recursively to resolve type definition using hints.
const typeDefDict = {};
const typeDefDict: TypeDefDict = {};
for (let i = 0; i < theType.fieldnames.length; i++) {
const arrayLen = theType.fieldarraylen[i];
const fieldName = theType.fieldnames[i];
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

/* Rules to be enabled */
"exactOptionalPropertyTypes": false /* Differentiate between undefined and not present when type checking */,
"noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably move it to the enabled section but if your next PR is to just replace every rule with strict: true then it doesn't really matter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, one sec, I realized this and also that as of this PR we can set strict: true and remove a bunch of these explicit settings

"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,

"types": ["@types/node"]
},
Expand Down