From 21433049b8ea5fd7fff3a681f2a1ff6b9cb7c2f3 Mon Sep 17 00:00:00 2001 From: Vinit Date: Fri, 6 Sep 2024 21:52:20 +0200 Subject: [PATCH] fix: eslint no-unused vars violations and setup @typescript-eslint documents recommends turning off the base unused-vars rule in eslint explicitly and using '@typescript-eslint/no-unused var' instead. In this case, the base rule failed to correctly report enums. (reported unused even though they were used). Also, fixed two unused variables by adding ignore pattern '_'. --- .eslintrc.json | 3 ++- nip29.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 75dc9402..a210ef2e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -116,7 +116,8 @@ "no-unexpected-multiline": 2, "no-unneeded-ternary": [2, { "defaultAssignment": false }], "no-unreachable": 2, - "no-unused-vars": [2, { "vars": "local", "args": "none", "varsIgnorePattern": "^_" }], + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [2, { "vars": "local", "args": "none", "varsIgnorePattern": "^_" }], "no-useless-call": 2, "no-useless-constructor": 2, "no-with": 2, diff --git a/nip29.ts b/nip29.ts index d39e554c..3b9a1f30 100644 --- a/nip29.ts +++ b/nip29.ts @@ -144,7 +144,7 @@ export function validateGroupAdminsEvent(event: Event): boolean { } // validate permissions - for (const [tag, value, label, ...permissions] of event.tags) { + for (const [tag, _value, _label, ...permissions] of event.tags) { if (tag !== 'p') continue for (let i = 0; i < permissions.length; i += 1) {