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 '_'.
This commit is contained in:
Vinit 2024-09-06 21:52:20 +02:00 committed by fiatjaf_
parent e8ff68f0b3
commit 21433049b8
2 changed files with 3 additions and 2 deletions

View File

@ -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,

View File

@ -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) {