Skip to content

Commit 1dbe9df

Browse files
vveerrggclaude
andcommitted
fix(lint): fix eslint config and resolve lint errors
- Move ignores to top-level config object (was ineffective inside files block) - Exclude dist/, coverage/, scripts/, *.d.ts from linting - Add require to globals for CJS fallback in nip46-signer - Fix unused variable lint errors (empty catch, _ prefixes) - 0 errors, 37 warnings (all no-explicit-any in tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 731ca10 commit 1dbe9df

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

eslint.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import tseslint from '@typescript-eslint/eslint-plugin';
33
import tsparser from '@typescript-eslint/parser';
44

55
export default [
6+
{
7+
ignores: ['dist/**', 'coverage/**', 'node_modules/**', 'scripts/**', '**/*.d.ts']
8+
},
69
{
710
files: ['**/*.ts'],
8-
ignores: ['dist/**', 'node_modules/**'],
911
languageOptions: {
1012
parser: tsparser,
1113
parserOptions: {
@@ -22,7 +24,8 @@ export default [
2224
clearInterval: 'readonly',
2325
Buffer: 'readonly',
2426
setTimeout: 'readonly',
25-
clearTimeout: 'readonly'
27+
clearTimeout: 'readonly',
28+
require: 'readonly'
2629
}
2730
},
2831
plugins: {
@@ -34,7 +37,7 @@ export default [
3437
'preserve-caught-error': 'off',
3538
'@typescript-eslint/no-explicit-any': 'warn',
3639
'@typescript-eslint/explicit-function-return-type': 'off',
37-
'@typescript-eslint/no-unused-vars': ['error', {
40+
'@typescript-eslint/no-unused-vars': ['error', {
3841
'argsIgnorePattern': '^_',
3942
'varsIgnorePattern': '^_'
4043
}],

src/__tests__/nip46-auth-handler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ vi.mock('nostr-crypto-utils/nip46', () => {
1212
};
1313

1414
return {
15-
parseBunkerURI: vi.fn((uri: string) => ({
15+
parseBunkerURI: vi.fn((_uri: string) => ({
1616
remotePubkey: 'a'.repeat(64),
1717
relays: ['wss://relay.example.com'],
1818
secret: 'test-secret',
@@ -85,7 +85,7 @@ describe('Nip46AuthHandler', () => {
8585

8686
mockTransport = {
8787
sendEvent: vi.fn(async () => {}),
88-
subscribe: vi.fn((filter, onEvent) => {
88+
subscribe: vi.fn((_filter, _onEvent) => {
8989
// Will be controlled per-test
9090
return () => {};
9191
}),

src/middleware/nip46-signer.middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class Nip46SignerMiddleware {
9696
let unwrapped;
9797
try {
9898
unwrapped = unwrapRequest(event, this.config.signerSecretKey);
99-
} catch (err) {
99+
} catch {
100100
res.status(400).json({ error: 'Failed to decrypt request' });
101101
return;
102102
}

0 commit comments

Comments
 (0)