Skip to content

Commit

Permalink
Use ESLint v9 for Node linting (#743)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Aug 23, 2024
1 parent 3bf9475 commit 03d8d52
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 26 deletions.
22 changes: 11 additions & 11 deletions node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@
"pkcs11js": "^2.1.0"
},
"devDependencies": {
"@cyclonedx/cyclonedx-npm": "^1.18.0",
"@cyclonedx/cyclonedx-npm": "^1.19.3",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.3.0",
"@eslint/js": "^9.9.0",
"@tsconfig/node18": "^18.2.4",
"@types/google-protobuf": "^3.15.12",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.31",
"eslint": "^8.57.0",
"@types/node": "^18.19.45",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-tsdoc": "^0.2.17",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-tsdoc": "^0.3.0",
"jest": "^29.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typedoc": "^0.25.13",
"typescript": "~5.4.5",
"typescript-eslint": "^7.9.0"
"prettier": "^3.3.3",
"ts-jest": "^29.2.4",
"typedoc": "^0.26.6",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0"
}
}
2 changes: 0 additions & 2 deletions node/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

/* eslint-disable jest/no-export */

import * as grpc from '@grpc/grpc-js';
import { common, gateway } from '@hyperledger/fabric-protos';
import { GatewayClient, newGatewayClient } from './client';
Expand Down
8 changes: 4 additions & 4 deletions node/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ class GatewayClientImpl implements GatewayClient {
);
}

#makeServerStreamRequest<RequestType extends Message, ResponseType>(
#makeServerStreamRequest<ResponseType>(
method: string,
deserialize: (value: Buffer) => ResponseType,
argument: RequestType,
argument: Message,
options: CallOptions,
): CloseableAsyncIterable<ResponseType> {
try {
Expand Down Expand Up @@ -261,10 +261,10 @@ class GatewayClientImpl implements GatewayClient {
);
}

#makeBidiStreamRequest<RequestType extends Message, ResponseType>(
#makeBidiStreamRequest<ResponseType>(
method: string,
deserialize: (value: Buffer) => ResponseType,
request: RequestType,
request: Message,
options: CallOptions,
): CloseableAsyncIterable<ResponseType> {
try {
Expand Down
2 changes: 1 addition & 1 deletion node/src/dependency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('optional pkcs11js dependency', () => {
expect(isLoaded('pkcs11js')).toBe(false);

const { privateKey } = generateKeyPairSync('ec', { namedCurve: 'P-256' });
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { signers } = require('.') as { signers: typeof SignersType };
signers.newPrivateKeySigner(privateKey);

Expand Down
1 change: 1 addition & 0 deletions node/src/filecheckpointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class FileCheckPointer implements Checkpointer {
async #readFile(): Promise<Buffer | undefined> {
try {
return await fs.promises.readFile(this.#path);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
// ignore file not exist error.
}
Expand Down
2 changes: 1 addition & 1 deletion node/src/identity/signers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function newHSMSignerFactory(library: string): HSMSignerFactory {
}

// Dynamic module load to prevent unnecessary load of optional pkcs11js dependency
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { HSMSignerFactoryImpl } = require('./hsmsigner') as {
HSMSignerFactoryImpl: typeof HSMSignerFactoryImplType;
};
Expand Down
14 changes: 7 additions & 7 deletions scenario/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"scripts": {
"build": "npm-run-all clean compile lint format",
"clean": "rimraf dist",
"clean": "rm -rf dist",
"cucumber": "NODE_OPTIONS='--enable-source-maps' cucumber-js --format cucumber-console-formatter --require 'dist/**/*.js' ../features",
"cucumber:no-hsm": "NODE_OPTIONS='--enable-source-maps' cucumber-js --tags 'not @hsm' --format cucumber-console-formatter --require 'dist/**/*.js' ../features",
"compile": "tsc",
Expand All @@ -25,16 +25,16 @@
"@hyperledger/fabric-protos": "^0.3.0"
},
"devDependencies": {
"@cucumber/cucumber": "^10.4.0",
"@cucumber/cucumber": "^10.9.0",
"@tsconfig/node18": "^18.2.4",
"@types/node": "^18.19.31",
"@types/node": "^18.19.45",
"cucumber-console-formatter": "^1.0.0",
"eslint": "^8.57.0",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"expect": "^29.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"typescript": "~5.4.5",
"typescript-eslint": "^7.9.0"
"prettier": "^3.3.3",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0"
}
}

0 comments on commit 03d8d52

Please sign in to comment.