Skip to content

Commit efbcaca

Browse files
upgrade dependencies
1 parent 0494f78 commit efbcaca

19 files changed

+5908
-1772
lines changed

.eslintrc.js

Lines changed: 462 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 5379 additions & 1712 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,45 @@
2525
"build:protos": "yarn build:protos:msgs && yarn build:protos:srvs",
2626
"build": "tsc -p tsconfig.release.json",
2727
"build:watch": "tsc -w -p tsconfig.release.json",
28-
"lint": "tslint -t stylish --project tsconfig.json",
29-
"lint:fix": "tslint --fix -t stylish --project tsconfig.json",
28+
"lint": "eslint -c .eslintrc.js --ext .ts .",
29+
"lint:fix": "eslint . --ext .ts --fix",
3030
"pretest": "yarn lint",
3131
"test": "jest --coverage --runInBand",
3232
"test:watch": "jest --watch",
3333
"coveralls": "cat ./coverage/lcov.info | coveralls"
3434
},
3535
"devDependencies": {
36-
"@types/google-protobuf": "^3.15.6",
37-
"@types/jest": "^29.4.0",
38-
"@types/node": "^18.11.18",
36+
"@types/google-protobuf": "^3.15.12",
37+
"@types/jest": "^29.5.12",
38+
"@types/node": "^20.14.2",
39+
"@typescript-eslint/eslint-plugin": "^7.13.0",
40+
"@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
41+
"@typescript-eslint/parser": "^7.13.0",
3942
"coveralls": "^3.1.1",
40-
"grpc-tools": "^1.12.4",
43+
"eslint": "^8.57.0",
44+
"eslint-plugin-import": "^2.29.1",
45+
"eslint-plugin-jest": "^28.6.0",
46+
"eslint-plugin-jsdoc": "^48.2.12",
47+
"eslint-plugin-jsx-a11y": "^6.8.0",
48+
"eslint-plugin-no-null": "^1.0.2",
49+
"eslint-plugin-prefer-arrow": "^1.2.3",
50+
"eslint-plugin-react": "^7.34.2",
51+
"eslint-plugin-security": "^3.0.1",
52+
"eslint-plugin-unicorn": "^54.0.0",
4153
"grpc_tools_node_protoc_ts": "^5.3.3",
54+
"grpc-tools": "^1.12.4",
4255
"install-peers": "^1.0.4",
43-
"jest": "^29.4.1",
56+
"jest": "^29.7.0",
4457
"jest-teamcity": "^1.11.0",
45-
"rimraf": "^4.1.2",
46-
"ts-jest": "^29.0.5",
58+
"rimraf": "^5.0.7",
59+
"ts-jest": "^29.1.5",
4760
"ts-protoc-gen": "^0.15.0",
48-
"tslint": "^6.1.3",
49-
"tslint-microsoft-contrib": "^6.2.0",
50-
"typescript": "^4.9.5"
61+
"typescript": "^5.4.5"
5162
},
5263
"dependencies": {
53-
"@grpc/grpc-js": "1.8.8",
54-
"@types/url-parse": "^1.4.8",
64+
"@grpc/grpc-js": "^1.10.9",
65+
"@types/url-parse": "^1.4.11",
66+
"eslint-plugin-lodash": "^7.4.0",
5567
"google-protobuf": "^3.21.2",
5668
"is-base64": "^1.1.0",
5769
"url-parse": "^1.5.10"

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class DgraphClient {
4848

4949
const c = this.anyClient();
5050
let payload: messages.Payload;
51-
const operation = async () => c.alter(op, metadata, options);
51+
const operation = async (): Promise<messages.Payload> => c.alter(op, metadata, options);
5252
try {
5353
payload = await operation();
5454
} catch (e) {
@@ -85,7 +85,7 @@ export class DgraphClient {
8585
*/
8686
public debug(msg: string): void {
8787
if (this.debugMode) {
88-
// tslint:disable-next-line no-console
88+
// eslint-disable-next-line no-console
8989
console.log(msg);
9090
}
9191
}

src/clientStub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ export class DgraphClientStub {
6161
options?: object,
6262
) {
6363
if (addr === undefined) {
64-
// tslint:disable-next-line no-parameter-reassignment
64+
// eslint-disable-next-line no-param-reassign
6565
addr = "localhost:9080";
6666
}
6767
if (credentials === undefined) {
68-
// tslint:disable-next-line no-parameter-reassignment
68+
// eslint-disable-next-line no-param-reassign
6969
credentials = grpc.credentials.createInsecure();
7070
}
7171

src/clientStubFromSlash.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ const PORT = "443";
1111
export function clientStubFromSlashGraphQLEndpoint(
1212
graphqlEndpoint: string,
1313
apiKey: string,
14-
) {
14+
): DgraphClientStub {
1515
return clientStubFromCloudEndpoint(graphqlEndpoint, apiKey);
1616
}
1717

1818
export function clientStubFromCloudEndpoint(
1919
graphqlEndpoint: string,
2020
apiKey: string,
21-
) {
21+
): DgraphClientStub {
2222
const url = new Url(graphqlEndpoint);
2323
const urlParts = url.host.split(".");
2424
const firstHalf = urlParts[0];

src/txn.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class Txn {
217217

218218
let resp: types.Response;
219219
const c = this.dc.anyClient();
220-
const operation = async () => c.query(req, metadata, options);
220+
const operation = async (): Promise<messages.Response> => c.query(req, metadata, options);
221221
try {
222222
resp = types.createResponse(await operation());
223223
} catch (e) {
@@ -274,7 +274,7 @@ export class Txn {
274274
}
275275

276276
const c = this.dc.anyClient();
277-
const operation = async () =>
277+
const operation = async (): Promise<messages.TxnContext> =>
278278
c.commitOrAbort(this.ctx, metadata, options);
279279
try {
280280
await operation();
@@ -313,7 +313,7 @@ export class Txn {
313313

314314
this.ctx.setAborted(true);
315315
const c = this.dc.anyClient();
316-
const operation = async () =>
316+
const operation = async (): Promise<messages.TxnContext> =>
317317
c.commitOrAbort(this.ctx, metadata, options);
318318
try {
319319
await operation();

src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ export class Mutation extends messages.Mutation {
248248
super.setSetNquads(value);
249249
return;
250250
}
251-
// tslint:disable-next-line no-unsafe-any
252251
if (isBase64(value)) {
253252
super.setSetNquads(value);
254253
return;
@@ -289,7 +288,6 @@ export class Mutation extends messages.Mutation {
289288
super.setDelNquads(value);
290289
return;
291290
}
292-
// tslint:disable-next-line no-unsafe-any
293291
if (isBase64(value)) {
294292
super.setDelNquads(value);
295293
return;

src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export function errorCode(err: any): { valid: boolean; code: number } { // tslin
55
if (
66
err === undefined ||
77
typeof err !== "object" ||
8-
!err.hasOwnProperty("code") || // tslint:disable-line no-unsafe-any
9-
typeof err.code !== "number" // tslint:disable-line no-unsafe-any
8+
!err.hasOwnProperty("code") || // eslint-disable-line @typescript-eslint/tslint/config
9+
typeof err.code !== "number" // eslint-disable-line @typescript-eslint/tslint/config
1010
) {
1111
return {
1212
valid: false,

tests/client.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import * as dgraph from "../src";
22

33
import { createClient, createClientStub } from "./helper";
44

5-
// tslint:disable no-console
5+
/* eslint-disable no-console */
66
describe("client", () => {
77
describe("constructor", () => {
88
it("should throw no clients error if no client stubs are passed", () => {
99
expect.assertions(1);
1010

1111
try {
12-
// tslint:disable-next-line no-unused-expression
12+
// eslint-disable-next-line no-unused-expressions
1313
new dgraph.DgraphClient();
1414
} catch (e) {
1515
expect(e).toBe(dgraph.ERR_NO_CLIENTS);

0 commit comments

Comments
 (0)