« get me outta code hell

lots of fixes from eslint - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-06-26 20:57:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-06-26 20:57:06 -0300
commit08b700bb14e5e12c1dff283e2eef729816a97f15 (patch)
tree0494ff87d7ede3e0d7f561063c08c74011204486 /src/page
parentc6e9aba1f6d1239b3d884c2749d1f0d15c7662a1 (diff)
lots of fixes from eslint
Diffstat (limited to 'src/page')
-rw-r--r--src/page/album-commentary.js5
-rw-r--r--src/page/album.js29
-rw-r--r--src/page/artist-alias.js4
-rw-r--r--src/page/artist.js7
-rw-r--r--src/page/flash.js3
-rw-r--r--src/page/group.js1
-rw-r--r--src/page/listing.js2
-rw-r--r--src/page/news.js2
-rw-r--r--src/page/static.js4
-rw-r--r--src/page/tag.js17
-rw-r--r--src/page/track.js14
11 files changed, 23 insertions, 65 deletions
diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js
index 8a5ba069..255a6584 100644
--- a/src/page/album-commentary.js
+++ b/src/page/album-commentary.js
@@ -18,9 +18,7 @@ export function targets({wikiData}) {
   return filterAlbumsByCommentary(wikiData.albumData);
 }
 
-export function write(album, {wikiData}) {
-  const {wikiInfo} = wikiData;
-
+export function write(album) {
   const entries = [album, ...album.tracks]
     .filter((x) => x.commentary)
     .map((x) => x.commentary);
@@ -35,7 +33,6 @@ export function write(album, {wikiData}) {
       getThemeString,
       link,
       language,
-      to,
       transformMultiline,
     }) => ({
       title: language.$('albumCommentaryPage.title', {album: album.name}),
diff --git a/src/page/album.js b/src/page/album.js
index 5b7bc975..12755ae9 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -23,8 +23,6 @@ export function targets({wikiData}) {
 }
 
 export function write(album, {wikiData}) {
-  const {wikiInfo} = wikiData;
-
   const unbound_trackToListItem = (
     track,
     {getArtistString, getLinkThemeString, link, language}
@@ -262,7 +260,6 @@ export function write(album, {wikiData}) {
                                   .map(
                                     ({
                                       name,
-                                      color,
                                       startIndex,
                                       tracks,
                                     }) => fixWS`
@@ -383,21 +380,23 @@ export function write(album, {wikiData}) {
 
 // Utility functions
 
-export function generateAlbumSidebar(
-  album,
-  currentTrack,
-  {fancifyURL, getLinkThemeString, link, language, transformMultiline, wikiData}
-) {
+export function generateAlbumSidebar(album, currentTrack, {
+  fancifyURL,
+  getLinkThemeString,
+  link,
+  language,
+  transformMultiline,
+}) {
   const listTag = getAlbumListTag(album);
 
   /*
-    const trackGroups = album.trackGroups || [{
-        name: language.$('albumSidebar.trackList.fallbackGroupName'),
-        color: album.color,
-        startIndex: 0,
-        tracks: album.tracks
-    }];
-    */
+  const trackGroups = album.trackGroups || [{
+      name: language.$('albumSidebar.trackList.fallbackGroupName'),
+      color: album.color,
+      startIndex: 0,
+      tracks: album.tracks
+  }];
+  */
 
   const {trackGroups} = album;
 
diff --git a/src/page/artist-alias.js b/src/page/artist-alias.js
index 46ad1a34..3d882f65 100644
--- a/src/page/artist-alias.js
+++ b/src/page/artist-alias.js
@@ -7,9 +7,7 @@ export function targets({wikiData}) {
   return wikiData.artistAliasData;
 }
 
-export function write(aliasArtist, {wikiData}) {
-  // This function doesn't actually use wikiData, 8ut, um, consistency?
-
+export function write(aliasArtist) {
   const {aliasedArtist} = aliasArtist;
 
   const redirect = {
diff --git a/src/page/artist.js b/src/page/artist.js
index eb57f5cf..481b4e36 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -16,8 +16,6 @@ import {
   chunkByProperties,
   getTotalDuration,
   sortAlbumsTracksChronologically,
-  sortByDate,
-  sortByDirectory,
   sortChronologically,
 } from '../util/wiki-data.js';
 
@@ -357,7 +355,6 @@ export function write(artist, {wikiData}) {
       getArtistString,
       link,
       language,
-      to,
       transformMultiline,
     }) => {
       const generateTrackList = bindOpts(unbound_generateTrackList, {
@@ -514,7 +511,6 @@ export function write(artist, {wikiData}) {
                                         ${chunk
                                           .map(
                                             ({
-                                              album,
                                               track,
                                               key,
                                               ...props
@@ -629,7 +625,7 @@ export function write(artist, {wikiData}) {
                                     )}</dt>
                                     <dd><ul>
                                         ${chunk
-                                          .map(({album, track, ...props}) =>
+                                          .map(({track}) =>
                                             track
                                               ? language.$(
                                                   'artistPage.creditList.entry.track',
@@ -673,7 +669,6 @@ export function write(artist, {wikiData}) {
       getTrackCover,
       link,
       language,
-      to,
     }) => ({
       title: language.$('artistGalleryPage.title', {artist: name}),
 
diff --git a/src/page/flash.js b/src/page/flash.js
index 340927d6..a4b3b9b0 100644
--- a/src/page/flash.js
+++ b/src/page/flash.js
@@ -34,7 +34,6 @@ export function write(flash, {wikiData}) {
       getThemeString,
       link,
       language,
-      transformInline,
     }) => ({
       title: language.$('flashPage.title', {flash: flash.name}),
       theme: getThemeString(flash.color, [
@@ -188,7 +187,7 @@ function generateNavForFlash(
   flash,
   {generateChronologyLinks, generatePreviousNextLinks, link, language, wikiData}
 ) {
-  const {flashData, wikiInfo} = wikiData;
+  const {flashData} = wikiData;
 
   const previousNextLinks = generatePreviousNextLinks(flash, {
     data: flashData,
diff --git a/src/page/group.js b/src/page/group.js
index c7de2fbc..5a6b611e 100644
--- a/src/page/group.js
+++ b/src/page/group.js
@@ -292,7 +292,6 @@ function generateGroupNav(
     return {simple: true};
   }
 
-  const urlKey = isGallery ? 'localized.groupGallery' : 'localized.groupInfo';
   const linkKey = isGallery ? 'groupGallery' : 'groupInfo';
 
   const infoGalleryLinks = generateInfoGalleryLinks(currentGroup, isGallery, {
diff --git a/src/page/listing.js b/src/page/listing.js
index 90415ded..5db6c916 100644
--- a/src/page/listing.js
+++ b/src/page/listing.js
@@ -33,8 +33,6 @@ export function write(listing, {wikiData}) {
     return null;
   }
 
-  const {wikiInfo} = wikiData;
-
   const data = listing.data ? listing.data({wikiData}) : null;
 
   const page = {
diff --git a/src/page/news.js b/src/page/news.js
index bf581e43..478ff9d0 100644
--- a/src/page/news.js
+++ b/src/page/news.js
@@ -104,7 +104,7 @@ function generateNewsEntryNav(
   entry,
   {generatePreviousNextLinks, link, language, wikiData}
 ) {
-  const {wikiInfo, newsData} = wikiData;
+  const {newsData} = wikiData;
 
   // The newsData list is sorted reverse chronologically (newest ones first),
   // so the way we find next/previous entries is flipped from normal.
diff --git a/src/page/static.js b/src/page/static.js
index f4a81972..2a49ff87 100644
--- a/src/page/static.js
+++ b/src/page/static.js
@@ -14,11 +14,11 @@ export function targets({wikiData}) {
   return wikiData.staticPageData;
 }
 
-export function write(staticPage, {wikiData}) {
+export function write(staticPage) {
   const page = {
     type: 'page',
     path: ['staticPage', staticPage.directory],
-    page: ({language, transformMultiline}) => ({
+    page: ({transformMultiline}) => ({
       title: staticPage.name,
       stylesheet: staticPage.stylesheet,
 
diff --git a/src/page/tag.js b/src/page/tag.js
index 4b2322d0..38f7e213 100644
--- a/src/page/tag.js
+++ b/src/page/tag.js
@@ -17,7 +17,6 @@ export function targets({wikiData}) {
 }
 
 export function write(tag, {wikiData}) {
-  const {wikiInfo} = wikiData;
   const {taggedInThings: things} = tag;
 
   // Display things featuring this art tag in reverse chronological order,
@@ -30,14 +29,12 @@ export function write(tag, {wikiData}) {
     type: 'page',
     path: ['tag', tag.directory],
     page: ({
-      generatePreviousNextLinks,
       getAlbumCover,
       getGridHTML,
       getThemeString,
       getTrackCover,
       link,
       language,
-      to,
     }) => ({
       title: language.$('tagPage.title', {tag: tag.name}),
       theme: getThemeString(tag.color),
@@ -68,7 +65,6 @@ export function write(tag, {wikiData}) {
       },
 
       nav: generateTagNav(tag, {
-        generatePreviousNextLinks,
         link,
         language,
         wikiData,
@@ -83,13 +79,8 @@ export function write(tag, {wikiData}) {
 
 function generateTagNav(
   tag,
-  {generatePreviousNextLinks, link, language, wikiData}
+  {link, language, wikiData}
 ) {
-  const previousNextLinks = generatePreviousNextLinks(tag, {
-    data: wikiData.artTagData.filter((tag) => !tag.isContentWarning),
-    linkKey: 'tag',
-  });
-
   return {
     linkContainerClasses: ['nav-links-hierarchy'],
     links: [
@@ -103,12 +94,6 @@ function generateTagNav(
           tag: link.tag(tag, {class: 'current'}),
         }),
       },
-      /*
-            previousNextLinks && {
-                divider: false,
-                html: `(${previousNextLinks})`
-            }
-            */
     ],
   };
 }
diff --git a/src/page/track.js b/src/page/track.js
index a9758ec2..29a07431 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -30,7 +30,7 @@ export function targets({wikiData}) {
 }
 
 export function write(track, {wikiData}) {
-  const {groupData, wikiInfo} = wikiData;
+  const {wikiInfo} = wikiData;
   const {album, referencedByTracks, referencedTracks, otherReleases} = track;
 
   const listTag = getAlbumListTag(album);
@@ -61,17 +61,6 @@ export function write(track, {wikiData}) {
       })
     );
 
-  const unbound_generateTrackList = (
-    tracks,
-    {getArtistString, link, language}
-  ) =>
-    html.tag(
-      'ul',
-      tracks.map((track) =>
-        unbound_getTrackItem(track, {getArtistString, link, language})
-      )
-    );
-
   const hasCommentary =
     track.commentary || otherReleases.some((t) => t.commentary);
   const generateCommentary = ({link, language, transformMultiline}) =>
@@ -182,7 +171,6 @@ export function write(track, {wikiData}) {
       getTrackCover,
       link,
       language,
-      transformInline,
       transformLyrics,
       transformMultiline,
       to,