« get me outta code hell

eslint: make use of optional catch binding more often - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-27 19:39:39 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-27 19:46:23 -0300
commit68a09934a1f38c0d0ea3fabc64a5390894d931fa (patch)
tree5493dcde92b75da67ffc1eb24d9d0c5fc1212ae5 /src/data
parent255102c21db9194535d304f181a2a0145e9b3c8a (diff)
eslint: make use of optional catch binding more often
Diffstat (limited to 'src/data')
-rw-r--r--src/data/cacheable-object.js4
-rw-r--r--src/data/checks.js2
-rw-r--r--src/data/thing.js4
-rw-r--r--src/data/things/artist.js2
-rw-r--r--src/data/things/contribution.js2
-rw-r--r--src/data/yaml.js2
6 files changed, 8 insertions, 8 deletions
diff --git a/src/data/cacheable-object.js b/src/data/cacheable-object.js
index a089e325..651a61cf 100644
--- a/src/data/cacheable-object.js
+++ b/src/data/cacheable-object.js
@@ -243,13 +243,13 @@ export class CacheableObjectPropertyValueError extends Error {
 
     try {
       inspectOldValue = inspect(oldValue);
-    } catch (error) {
+    } catch {
       inspectOldValue = colors.red(`(couldn't inspect)`);
     }
 
     try {
       inspectNewValue = inspect(newValue);
-    } catch (error) {
+    } catch {
       inspectNewValue = colors.red(`(couldn't inspect)`);
     }
 
diff --git a/src/data/checks.js b/src/data/checks.js
index 54bf85fd..a2a2e08f 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -686,7 +686,7 @@ export function reportContentTextErrors(wikiData, {
       } else if (node.type === 'external-link') {
         try {
           new URL(node.data.href);
-        } catch (error) {
+        } catch {
           yield {
             index, length,
             message:
diff --git a/src/data/thing.js b/src/data/thing.js
index 66f73de5..f719224d 100644
--- a/src/data/thing.js
+++ b/src/data/thing.js
@@ -60,7 +60,7 @@ export default class Thing extends CacheableObject {
       if (this.name) {
         name = colors.green(`"${this.name}"`);
       }
-    } catch (error) {
+    } catch {
       name = colors.yellow(`couldn't get name`);
     }
 
@@ -69,7 +69,7 @@ export default class Thing extends CacheableObject {
       if (this.directory) {
         reference = colors.blue(Thing.getReference(this));
       }
-    } catch (error) {
+    } catch {
       reference = colors.yellow(`couldn't get reference`);
     }
 
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index f516098b..5b67051c 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -286,7 +286,7 @@ export class Artist extends Thing {
       let aliasedArtist;
       try {
         aliasedArtist = this.aliasedArtist.name;
-      } catch (_error) {
+      } catch {
         aliasedArtist = CacheableObject.getUpdateValue(this, 'aliasedArtist');
       }
 
diff --git a/src/data/things/contribution.js b/src/data/things/contribution.js
index c92fafb4..b3655eb8 100644
--- a/src/data/things/contribution.js
+++ b/src/data/things/contribution.js
@@ -259,7 +259,7 @@ export class Contribution extends Thing {
       let artist;
       try {
         artist = this.artist;
-      } catch (_error) {
+      } catch {
         // Computing artist might crash for any reason - don't distract from
         // other errors as a result of inspecting this contribution.
       }
diff --git a/src/data/yaml.js b/src/data/yaml.js
index e8d24353..9a0295b8 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1022,7 +1022,7 @@ export const documentModes = {
 export function getAllDataSteps() {
   try {
     thingConstructors;
-  } catch (error) {
+  } catch {
     throw new Error(`Thing constructors aren't ready yet, can't get all data steps`);
   }