From a51461cbcbb7b521ed7725bc55c1a1b00cbc2882 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Wed, 30 Apr 2025 08:47:31 +1000 Subject: [PATCH 1/4] chore: format check for ci --- .github/workflows/build.yml | 5 +++-- package.json | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6929226..6a391d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x, 20.x] + node-version: [16.x, 18.x, 20.x, 22.x] steps: - uses: actions/checkout@v4 @@ -24,6 +24,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm i - run: npm run typecheck + - run: npm run format:check - run: npm test - run: npm run build - - run: npm run test-imports + - run: npm run test:imports diff --git a/package.json b/package.json index 2861d89..5198954 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "author": "Dmitry Shirokov ", "contributors": [ "William Storey @horgh", - "Uman Shahzad @UmanShahzad" + "Uman Shahzad @UmanShahzad", + "Gregory Oschwald @oschwald" ], "devDependencies": { "@types/ip-address": "7.0.0", @@ -50,8 +51,9 @@ "build": "rm -rf lib/* && tsc", "typecheck": "tsc --noEmit", "test": "mocha", - "test-imports": "node test/imports/commonjs.js && node test/imports/esm.mjs && ts-node test/imports/typescript.ts", + "test:imports": "node test/imports/commonjs.js && node test/imports/esm.mjs && ts-node test/imports/typescript.ts", "format": "prettier --write src", + "format:check": "prettier --check src", "prepublish": "npm run build", "semantic-release": "semantic-release" } From bc1d94699827ffb3614494efc253f402c8cfdca2 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Wed, 30 Apr 2025 08:49:30 +1000 Subject: [PATCH 2/4] format files --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 2905baf..dbff154 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -19,7 +19,7 @@ const assert = (condition: boolean, message: string): void => { if (!condition) { throw new Error(message); } -} +}; export default { assert, From 734ea2faa94d6a9b8d67687d2ef2e350fc080355 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Wed, 30 Apr 2025 08:56:07 +1000 Subject: [PATCH 3/4] resolve conflicts --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5198954..eba3914 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@types/sinon": "17.0.4", "ip-address": "10.0.1", "mocha": "^11.0.0", - "prettier": "^3.0.0", + "prettier": "^3.5.3", "semantic-release": "^24.0.0", "sinon": "20.0.0", "ts-node": "^10.4.0", From bf331ca48a59d2bd4ec385945d256807f5651b71 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Wed, 30 Apr 2025 09:02:10 +1000 Subject: [PATCH 4/4] prettier config --- .prettierignore | 4 ++++ .prettierrc | 3 ++- src/reader/response.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f4d9ac1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +build +coverage +lib +test/data diff --git a/.prettierrc b/.prettierrc index e537c8a..cb68d5c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "singleQuote": true, "trailingComma": "es5", - "arrowParens": "always" + "arrowParens": "always", + "tabWidth": 2 } diff --git a/src/reader/response.ts b/src/reader/response.ts index e92c5ba..b5bdabb 100644 --- a/src/reader/response.ts +++ b/src/reader/response.ts @@ -126,8 +126,8 @@ export interface AnonymousIPResponse { export interface AnonymousPlusResponse extends AnonymousIPResponse { readonly anonymizer_confidence?: number; - readonly network_last_seen?: string - readonly provider_name?: string + readonly network_last_seen?: string; + readonly provider_name?: string; } export interface AsnResponse {