Skip to content

Commit

Permalink
Enforce eslint no-unused-vars (#322)
Browse files Browse the repository at this point in the history
- Flag `no-unused-vars` violations as errors
- Remove spurious import in HMAC tests
- Remove spurious namespace arg to `renderAttrs()`
  • Loading branch information
LoneRifle authored Jun 26, 2023
1 parent 4040b6a commit 32795f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"extends": ["eslint:recommended", "prettier"],
"rules": {
"no-console": "error",
"no-unused-vars": "warn",
"no-unused-vars": "error",
"no-prototype-builtins": "error",
"one-var": ["error", "never"],
"no-duplicate-imports": "error",
Expand Down
4 changes: 2 additions & 2 deletions lib/c14n-canonicalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class C14nCanonicalization {
return attr1.localeCompare(attr2);
}

renderAttrs(node, defaultNS) {
renderAttrs(node) {
let i;
let attr;
const attrListToRender = [];
Expand Down Expand Up @@ -171,7 +171,7 @@ class C14nCanonicalization {
defaultNsForPrefix,
ancestorNamespaces
);
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node, ns.newDefaultNs), ">"];
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node), ">"];

for (i = 0; i < node.childNodes.length; ++i) {
pfxCopy = prefixesInScope.slice(0);
Expand Down
4 changes: 2 additions & 2 deletions lib/exclusive-canonicalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ExclusiveCanonicalization {
return attr1.localeCompare(attr2);
}

renderAttrs(node, defaultNS) {
renderAttrs(node) {
let i;
let attr;
const res = [];
Expand Down Expand Up @@ -183,7 +183,7 @@ class ExclusiveCanonicalization {
defaultNsForPrefix,
inclusiveNamespacesPrefixList
);
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node, ns.newDefaultNs), ">"];
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node), ">"];

for (i = 0; i < node.childNodes.length; ++i) {
pfxCopy = prefixesInScope.slice(0);
Expand Down
1 change: 0 additions & 1 deletion test/hmac-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const crypto = require("../index");
const xpath = require("xpath");
const xmldom = require("@xmldom/xmldom");
const fs = require("fs");
const { sign } = require("crypto");
const expect = require("chai").expect;

describe("HMAC tests", function () {
Expand Down

0 comments on commit 32795f3

Please sign in to comment.