Skip to content

Commit 53553d6

Browse files
authored
Enable strictPropertyInitialization (#1046)
1 parent bb4bf64 commit 53553d6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/actionlib/SimpleActionServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class SimpleActionServer<
3838
result?: TResult;
3939
status: actionlib_msgs.GoalStatus;
4040
}>;
41-
statusPublisher: Topic<actionlib_msgs.GoalStatusArray>;
41+
statusPublisher?: Topic<actionlib_msgs.GoalStatusArray>;
4242
statusMessage: actionlib_msgs.GoalStatusArray;
4343
/**
4444
* @param options

src/core/Topic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export default class Topic<T> extends EventEmitter<{
4242
callForSubscribeAndAdvertise: (
4343
message: RosbridgeSubscribeMessage | RosbridgeAdvertiseMessage,
4444
) => void;
45-
subscribeId: string | null;
46-
advertiseId: string;
45+
subscribeId: string | null = null;
46+
advertiseId?: string;
4747
/**
4848
* @param options
4949
* @param options.ros - The ROSLIB.Ros connection handle.

src/tf/ROS2TFClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class ROS2TFClient extends BaseTFClient {
1212
tf2_web_republisher.TFSubscriptionResult,
1313
tf2_web_republisher.TFSubscriptionFeedback
1414
>;
15-
currentGoal: tf2_web_republisher.TFSubscriptionGoal;
15+
currentGoal?: tf2_web_republisher.TFSubscriptionGoal;
1616

1717
constructor(options: ConstructorParameters<typeof BaseTFClient>[0]) {
1818
super(options);

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
"strictBindCallApply": true /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */,
4242
"strictBuiltinIteratorReturn": true /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */,
4343
"useUnknownInCatchVariables": true /* Default catch clause variables as `unknown` instead of `any`. */,
44+
"strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
4445
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
4546

4647
/* Rules to be enabled */
4748
"exactOptionalPropertyTypes": false /* Differentiate between undefined and not present when type checking */,
4849
"noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
4950
"noUncheckedIndexedAccess": false /* Add `undefined` to a type when accessed using an index. */,
5051
"strictFunctionTypes": false /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
51-
"strictPropertyInitialization": false /* Check for class properties that are declared but not set in the constructor. */,
5252

5353
"types": ["@types/node"]
5454
},

0 commit comments

Comments
 (0)