Skip to content

Commit 1e6d971

Browse files
Merge pull request #191 from shubham1172/shubham1172/resolve-linter-issues
Resolve linter issues
2 parents ea0cc53 + ba5e9d3 commit 1e6d971

File tree

32 files changed

+62
-71
lines changed

32 files changed

+62
-71
lines changed

.eslintrc.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"node": true
1515
},
1616
"rules": {
17-
"@typescript-eslint/ban-ts-comment": "off"
17+
"@typescript-eslint/ban-ts-comment": "off",
18+
"@typescript-eslint/no-explicit-any": "off",
19+
"@typescript-eslint/no-unused-vars": ["warn", {
20+
"varsIgnorePattern": "^_",
21+
"argsIgnorePattern": "^_"
22+
}]
1823
}
1924
}

examples/configuration/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { DaprClient, CommunicationProtocolEnum } from "dapr-client";
1+
import { DaprClient } from "dapr-client";
22

33
const daprHost = "127.0.0.1";
4-
const daprAppId = "example-config";
4+
const daprPortDefault = "3500";
55

66
async function start() {
77

88
const client = new DaprClient(
99
daprHost,
10-
process.env.DAPR_HTTP_PORT
10+
process.env.DAPR_HTTP_PORT ?? daprPortDefault
1111
);
1212

1313
const config = await client.configuration.get('config-store', ['key1', 'key2']);

examples/grpc/hello-world/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DaprServer, DaprClient, HttpMethod, CommunicationProtocolEnum } from "d
22

33
const daprHost = "127.0.0.1";
44
const daprPort = "50050"; // Dapr Sidecar Port of this Example Server
5-
const daprPortActor = "10002"; // Dapr Sidecar Port of the Actor Server
5+
// const daprPortActor = "10002"; // Dapr Sidecar Port of the Actor Server
66
const serverHost = "127.0.0.1"; // App Host of this Example Server
77
const serverPort = "50051"; // App Port of this Example Server
88
const daprAppId = "example-hello-world";

examples/http/actor/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DaprServer, DaprClient, HttpMethod } from "dapr-client";
1+
import { DaprServer, DaprClient } from "dapr-client";
22
import DemoActorCounterImpl from "./actor/DemoActorCounterImpl";
33
import DemoActorReminderImpl from "./actor/DemoActorReminderImpl";
44
import DemoActorSayImpl from "./actor/DemoActorSayImpl";
@@ -8,7 +8,6 @@ const daprHost = "127.0.0.1";
88
const daprPort = "50000"; // Dapr Sidecar Port of this Example Server
99
const serverHost = "127.0.0.1"; // App Host of this Example Server
1010
const serverPort = "50001"; // App Port of this Example Server
11-
const daprAppId = "example-hello-world";
1211

1312
async function start() {
1413
const server = new DaprServer(serverHost, serverPort, daprHost, daprPort);
@@ -33,7 +32,6 @@ async function start() {
3332
console.log("EXECUTING CLIENT - ACTORS");
3433
console.log("Note: we create new client for now since Actors are not supported internally!")
3534
console.log("===============================================================");
36-
const actorId = "MyActorId1";
3735

3836
const resRegisteredActors = await server.actor.getRegisteredActors();
3937
console.log(`Registered Actor Types: ${JSON.stringify(resRegisteredActors)}`);

examples/http/pubsub/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const daprHost = "127.0.0.1";
44
const daprPort = "50000"; // Dapr Sidecar Port of this Example Server
55
const serverHost = "127.0.0.1"; // App Host of this Example Server
66
const serverPort = "50001"; // App Port of this Example Server
7-
const daprAppId = "example-http-pubsub";
87

98
async function start() {
109
// Create a Server (will subscribe) and Client (will publish)

examples/invocation/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DaprServer, DaprClient, HttpMethod, CommunicationProtocolEnum } from "dapr-client";
1+
import { DaprServer, DaprClient, HttpMethod } from "dapr-client";
22

33
// Common settings
44
const daprAppId = "example-invocation";

examples/pubsub/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DaprServer, DaprClient, CommunicationProtocolEnum } from "dapr-client";
1+
import { DaprServer, DaprClient } from "dapr-client";
22

33
// Common settings
44
const serverHost = "127.0.0.1"; // App Host of this Example Server

src/actors/client/ActorClient/ActorClientGRPC.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class ActorClientGRPC implements IClientActor {
6969

7070
return new Promise((resolve, reject) => {
7171
const client = this.client.getClient();
72-
client.executeActorStateTransaction(msgService, (err, res) => {
72+
client.executeActorStateTransaction(msgService, (err, _res) => {
7373
if (err) {
7474
return reject(err);
7575
}
@@ -126,7 +126,7 @@ export default class ActorClientGRPC implements IClientActor {
126126

127127
return new Promise((resolve, reject) => {
128128
const client = this.client.getClient();
129-
client.registerActorReminder(msgService, (err, res) => {
129+
client.registerActorReminder(msgService, (err, _res) => {
130130
if (err) {
131131
return reject(err);
132132
}
@@ -145,7 +145,7 @@ export default class ActorClientGRPC implements IClientActor {
145145

146146
return new Promise((resolve, reject) => {
147147
const client = this.client.getClient();
148-
client.unregisterActorReminder(msgService, (err, res) => {
148+
client.unregisterActorReminder(msgService, (err, _res) => {
149149
if (err) {
150150
return reject(err);
151151
}
@@ -180,7 +180,7 @@ export default class ActorClientGRPC implements IClientActor {
180180

181181
return new Promise((resolve, reject) => {
182182
const client = this.client.getClient();
183-
client.registerActorTimer(msgService, (err, res) => {
183+
client.registerActorTimer(msgService, (err, _res) => {
184184
if (err) {
185185
return reject(err);
186186
}
@@ -199,7 +199,7 @@ export default class ActorClientGRPC implements IClientActor {
199199

200200
return new Promise((resolve, reject) => {
201201
const client = this.client.getClient();
202-
client.unregisterActorTimer(msgService, (err, res) => {
202+
client.unregisterActorTimer(msgService, (err, _res) => {
203203
if (err) {
204204
return reject(err);
205205
}

src/actors/client/ActorProxyBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class ActorProxyBuilder<T> {
2727
const actorClient = this.actorClient;
2828

2929
const handler = {
30-
get(target: any, propKey: any, receiver: any) {
30+
get(_target: any, propKey: any, _receiver: any) {
3131
return async function (...args: any) {
3232
const body = args.length > 0 ? args : null;
3333
const res = await actorClient.actor.invoke(actorTypeClassName, actorId, propKey, body);

src/actors/runtime/AbstractActor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default abstract class AbstractActor {
7171
* @param <Type> Type of the state object
7272
* @return Async void response
7373
*/
74-
async registerActorReminder<Type>(reminderName: string, dueTime: Temporal.Duration, period: Temporal.Duration, state?: any) {
74+
async registerActorReminder<_Type>(reminderName: string, dueTime: Temporal.Duration, period: Temporal.Duration, state?: any) {
7575
await this.actorClient.actor.registerActorReminder(this.actorType, this.id, reminderName, {
7676
period,
7777
dueTime,
@@ -184,7 +184,7 @@ export default abstract class AbstractActor {
184184
return;
185185
}
186186

187-
async receiveReminder(data: string): Promise<void> {
187+
async receiveReminder(_data: string): Promise<void> {
188188
console.warn(JSON.stringify({
189189
error: "ACTOR_METHOD_NOT_IMPLEMENTED",
190190
errorMsg: `A reminder was created for the actor with id: ${this.id} but the method 'receiveReminder' was not implemented`,

0 commit comments

Comments
 (0)