Update linting so we don't need omit the context filling name of some variables (#165)

`"no-unused-vars": ["error", { "destructuredArrayIgnorePattern": "^_" }],` was only [introduced in `eslint@8.11.0`](0fd6bb213a/CHANGELOG.md) so we had to update
This commit is contained in:
Eric Eastwood 2023-04-07 13:01:20 -05:00 committed by GitHub
parent 57d2cb3dd3
commit 5aafa01f38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 409 additions and 185 deletions

View File

@ -16,7 +16,7 @@
"quotes": "off",
"eqeqeq": ["warn", "allow-null"],
"strict": ["error", "safe"],
"no-unused-vars": ["error"],
"no-unused-vars": ["error", { "destructuredArrayIgnorePattern": "^_" }],
"no-extra-boolean-cast": ["warn"],
"complexity": [
"error",

576
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,14 +24,14 @@
},
"devDependencies": {
"escape-string-regexp": "^4.0.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"merge-options": "^3.0.4",
"mocha": "^9.2.1",
"nodemon": "^2.0.15",
"prettier": "^2.5.1",
"prettier": "^2.8.7",
"vite": "^2.9.6"
},
"dependencies": {
@ -45,9 +45,9 @@
"@opentelemetry/resources": "^1.3.1",
"@opentelemetry/sdk-trace-base": "^1.3.1",
"@opentelemetry/semantic-conventions": "^1.3.1",
"cors": "^2.8.5",
"dompurify": "^2.3.9",
"express": "^4.17.2",
"cors": "^2.8.5",
"hydrogen-view-sdk": "npm:@mlm/hydrogen-view-sdk@^0.25.0-scratch",
"json5": "^2.2.1",
"linkedom": "^0.14.17",

View File

@ -9,14 +9,12 @@ function parseArchiveUrlForRoom(archiveUrlForRoom) {
const urlObj = new URL(archiveUrlForRoom);
const urlPathname = urlObj.pathname;
// eslint-disable-next-line no-unused-vars -- It's more clear to leave `match` so we can see what we're destructuring from
const [match, roomIdOrAliasDescriptor, roomIdOrAliasUrlPart, urlDateTime] = urlPathname.match(
const [_match, roomIdOrAliasDescriptor, roomIdOrAliasUrlPart, urlDateTime] = urlPathname.match(
/\/(r|roomid)\/(.*?)\/date\/(.*)/
);
const [sigil] = Object.entries(VALID_SIGIL_TO_ENTITY_DESCRIPTOR_MAP).find(
// eslint-disable-next-line no-unused-vars -- It's more clear to leave `sigil` so we can see what we're destructuring from
([sigil, entityDescriptor]) => roomIdOrAliasDescriptor === entityDescriptor
([_sigil, entityDescriptor]) => roomIdOrAliasDescriptor === entityDescriptor
);
const roomIdOrAlias = `${sigil}${roomIdOrAliasUrlPart}`;