diff --git a/.prettierignore b/.prettierignore index 2719209..7e893bf 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,6 @@ node_modules dist -archive* \ No newline at end of file +dist-test +archive* +.svelte-kit +.claude diff --git a/email-verification/src/__tests__/issuance-token.test.ts b/email-verification/src/__tests__/issuance-token.test.ts index bb6b46b..7e53d9d 100644 --- a/email-verification/src/__tests__/issuance-token.test.ts +++ b/email-verification/src/__tests__/issuance-token.test.ts @@ -144,7 +144,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing JWK algorithm', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { alg: _alg, ...keyWithoutAlg } = rsaPrivateKey await expect( @@ -153,7 +152,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing JWK kid', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { kid: _kid, ...keyWithoutKid } = rsaPrivateKey await expect( @@ -295,7 +293,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing cnf.jwk claim', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { cnf: _cnf, ...payloadWithoutCnf } = testPayload const header = { diff --git a/email-verification/src/__tests__/presentation-token.test.ts b/email-verification/src/__tests__/presentation-token.test.ts index 8896f49..2301f4e 100644 --- a/email-verification/src/__tests__/presentation-token.test.ts +++ b/email-verification/src/__tests__/presentation-token.test.ts @@ -233,7 +233,6 @@ describe('PresentationToken Functions', () => { }) it('should throw error for invalid JWK', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { alg: _alg, ...invalidKey } = rsaBrowserKey const issuanceTokenPayload: IssuanceTokenPayload = { diff --git a/eslint.config.mjs b/eslint.config.mjs index a5ae90d..6db6dac 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -8,7 +8,14 @@ export default [ ...tseslint.configs.recommended, prettierConfig, // Disable ESLint rules that conflict with Prettier { - ignores: ['**/dist', '**/dist-test', '**/node_modules', 'archive*/'], + ignores: [ + '**/dist', + '**/dist-test', + '**/node_modules', + '**/.svelte-kit', + 'archive*/', + '.claude/', + ], }, { languageOptions: { @@ -28,6 +35,18 @@ export default [ '@typescript-eslint/ban-ts-comment': 'off', // TBD: allow @ts-ignore comments '@typescript-eslint/no-empty-object-type': 'off', // TBD: Auth | {} allow empty object + + // Destructuring to omit members -- stripping private fields from a + // JWK, for example -- names the fields it is discarding. They are + // not unused; naming them is how the omission works. + '@typescript-eslint/no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + }, + ], }, }, ] diff --git a/httpsig/src/utils/crypto.ts b/httpsig/src/utils/crypto.ts index 0f26f3e..34d4178 100644 --- a/httpsig/src/utils/crypto.ts +++ b/httpsig/src/utils/crypto.ts @@ -249,7 +249,6 @@ export async function importPublicKey(jwk: JsonWebKey): Promise { * Extract public JWK from private JWK */ export function getPublicJwk(privateJwk: JsonWebKey): JsonWebKey { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { d, p, q, dp, dq, qi, ...publicJwk } = privateJwk return publicJwk } diff --git a/httpsig/tests/test-jkt-jwt.ts b/httpsig/tests/test-jkt-jwt.ts index fc1a895..60852bd 100644 --- a/httpsig/tests/test-jkt-jwt.ts +++ b/httpsig/tests/test-jkt-jwt.ts @@ -5,7 +5,7 @@ import { test } from 'node:test' import assert from 'node:assert' import { fetch, verify } from '../src/index.js' -import { base64urlEncode, base64urlDecode } from '../src/utils/base64.js' +import { base64urlEncode } from '../src/utils/base64.js' import { calculateThumbprint } from '../src/utils/thumbprint.js' /** diff --git a/web-identity/src/__tests__/issuance-token.test.ts b/web-identity/src/__tests__/issuance-token.test.ts index d6fd932..2d18805 100644 --- a/web-identity/src/__tests__/issuance-token.test.ts +++ b/web-identity/src/__tests__/issuance-token.test.ts @@ -144,7 +144,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing JWK algorithm', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { alg: _alg, ...keyWithoutAlg } = rsaPrivateKey await expect( @@ -153,7 +152,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing JWK kid', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { kid: _kid, ...keyWithoutKid } = rsaPrivateKey await expect( @@ -295,7 +293,6 @@ describe('IssuanceToken Functions', () => { }) it('should throw error for missing cnf.jwk claim', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { cnf: _cnf, ...payloadWithoutCnf } = testPayload const header = { diff --git a/web-identity/src/__tests__/presentation-token.test.ts b/web-identity/src/__tests__/presentation-token.test.ts index 3e899d6..3205c49 100644 --- a/web-identity/src/__tests__/presentation-token.test.ts +++ b/web-identity/src/__tests__/presentation-token.test.ts @@ -230,7 +230,6 @@ describe('PresentationToken Functions', () => { }) it('should throw error for invalid JWK', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { alg: _alg, ...invalidKey } = rsaBrowserKey const issuanceTokenPayload: IssuanceTokenPayload = { diff --git a/web-identity/src/__tests__/request-token.test.ts b/web-identity/src/__tests__/request-token.test.ts index 2d5ff17..b8fad22 100644 --- a/web-identity/src/__tests__/request-token.test.ts +++ b/web-identity/src/__tests__/request-token.test.ts @@ -80,7 +80,6 @@ describe('RequestToken Functions', () => { }) it('should throw error for missing JWK algorithm', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { alg: _alg, ...keyWithoutAlg } = rsaKey await expect( @@ -89,7 +88,6 @@ describe('RequestToken Functions', () => { }) it('should throw error for missing JWK kid', async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { kid: _kid, ...keyWithoutKid } = rsaKey await expect(