Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Feb 27, 2024
1 parent b88fccb commit 57b530a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
23 changes: 19 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,12 @@
"browser": false,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"plugins": ["prettier"],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"sanity",
"sanity/typescript",
"prettier"
],
"rules": {
"operator-linebreak": "off",
"prettier/prettier": "error"
},
"root": true
Expand All @@ -93,7 +86,7 @@
"body-parser": "^1.20.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-sanity": "^7.0.2",
"eslint-config-sanity": "^7.1.0",
"eslint-plugin-prettier": "^5.1.3",
"express": "^4.18.2",
"ls-engines": "^0.9.1",
Expand Down
4 changes: 2 additions & 2 deletions test/signature.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ describe.runIf(isWebCrypto)('signature', () => {

test('throws on non-string payload', async () => {
await expect(
// @ts-expect-error
// @ts-expect-error (testing invalid input)
() => encodeSignatureHeader({}, timestamp, secret),
).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Payload must be a JSON-encoded string]`)
})

test('throws on invalid timestamp type (invalid type)', async () => {
await expect(() =>
// @ts-expect-error
// @ts-expect-error (testing invalid input)
encodeSignatureHeader(stringifiedPayload, 'foo', secret),
).rejects.toThrowErrorMatchingInlineSnapshot(
`[Error: Invalid signature timestamp, must be a unix timestamp with millisecond precision]`,
Expand Down

0 comments on commit 57b530a

Please sign in to comment.