diff --git a/package-lock.json b/package-lock.json index fb52e36..204ffa9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "esbuild": "^0.18.0", "glob": "^10.2.6", "jest": "^29.0.0", - "prettier": "2.8.8", + "prettier": "3.0.0", "ts-jest": "^29.0.0", "typescript": "^5.0.0" }, @@ -3737,15 +3737,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -7347,9 +7347,9 @@ } }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true }, "pretty-format": { diff --git a/package.json b/package.json index 1d0bfda..60b9269 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "esbuild": "^0.18.0", "glob": "^10.2.6", "jest": "^29.0.0", - "prettier": "2.8.8", + "prettier": "3.0.0", "ts-jest": "^29.0.0", "typescript": "^5.0.0" }, diff --git a/src/index.ts b/src/index.ts index 302e9dd..2626118 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,7 +48,7 @@ export class RequestError extends Error { constructor( message: string, statusCode: number, - options: RequestErrorOptions + options: RequestErrorOptions, ) { super(message); @@ -77,7 +77,7 @@ export class RequestError extends Error { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( / .*$/, - " [REDACTED]" + " [REDACTED]", ), }); } @@ -97,8 +97,8 @@ export class RequestError extends Error { get() { logOnceCode( new Deprecation( - "[@octokit/request-error] `error.code` is deprecated, use `error.status`." - ) + "[@octokit/request-error] `error.code` is deprecated, use `error.status`.", + ), ); return statusCode; }, @@ -107,8 +107,8 @@ export class RequestError extends Error { get() { logOnceHeaders( new Deprecation( - "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." - ) + "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.", + ), ); return headers || {}; }, diff --git a/test/request-error.test.ts b/test/request-error.test.ts index 124f02c..a14be91 100644 --- a/test/request-error.test.ts +++ b/test/request-error.test.ts @@ -68,7 +68,7 @@ describe("RequestError", () => { const error = new RequestError("test", 123, options); expect(error.request.url).toEqual( - "https://api.github.com/?client_id=123&client_secret=[REDACTED]" + "https://api.github.com/?client_id=123&client_secret=[REDACTED]", ); }); @@ -84,7 +84,7 @@ describe("RequestError", () => { const error = new RequestError("test", 123, options); expect(error.request.url).toEqual( - "https://api.github.com/?client_id=123&client_secret=[REDACTED]" + "https://api.github.com/?client_id=123&client_secret=[REDACTED]", ); }); @@ -100,7 +100,7 @@ describe("RequestError", () => { const error = new RequestError("test", 123, options); expect(error.request.url).toEqual( - "https://api.github.com/?access_token=[REDACTED]" + "https://api.github.com/?access_token=[REDACTED]", ); }); @@ -141,15 +141,15 @@ describe("RequestError", () => { test("deprecates .headers", () => { global.console.warn = jest.fn(); expect(new RequestError("test", 123, mockOptions).headers).toStrictEqual( - {} + {}, ); expect( new RequestError("test", 404, { ...mockOptions, headers: { foo: "bar" } }) - .headers + .headers, ).toStrictEqual({ foo: "bar" }); expect( new RequestError("test", 404, { ...mockOptions, headers: undefined }) - .headers + .headers, ).toStrictEqual({}); expect(console.warn).toHaveBeenCalledTimes(1); });