Skip to content

Commit

Permalink
fix: eslint no-unused vars violations and setup
Browse files Browse the repository at this point in the history
@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 '_'.
  • Loading branch information
Vin-it authored and fiatjaf committed Sep 6, 2024
1 parent e8ff68f commit 2143304
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion nip29.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2143304

Please sign in to comment.