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/.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/package.json b/package.json index 2861d89..eba3914 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", @@ -22,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", @@ -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" } 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 { 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,