Przeglądaj źródła

Sanity-check decaffeinate the rest

Simon Legner 1 rok temu
rodzic
commit
e5fcde09f9

+ 0 - 7
assets/javascripts/application.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 //= require_tree ./vendor
 
 //= require lib/license

+ 0 - 12
assets/javascripts/debug.js

@@ -1,15 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS203: Remove `|| {}` from converted for-own loops
- * DS207: Consider shorter variations of null checks
- * DS208: Avoid top-level this
- * DS209: Avoid top-level return
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
 //
 // App
 //

+ 0 - 8
assets/javascripts/lib/favicon.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS208: Avoid top-level this
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 let defaultUrl = null;
 let currentSlug = null;
 

+ 0 - 2
assets/javascripts/lib/license.js

@@ -1,5 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
 /*
  * Copyright 2013-2023 Thibaut Courouble and other contributors
  *

+ 0 - 7
assets/javascripts/lib/local_storage_store.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 this.LocalStorageStore = class LocalStorageStore {
   get(key) {
     try {

+ 0 - 8
assets/javascripts/models/doc.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.models.Doc = class Doc extends app.Model {
   // Attributes: name, slug, type, version, release, db_size, mtime, links
 

+ 0 - 2
assets/javascripts/models/model.js

@@ -1,5 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
 app.Model = class Model {
   constructor(attributes) {
     for (var key in attributes) {

+ 0 - 7
assets/javascripts/models/type.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.models.Type = class Type extends app.Model {
   // Attributes: name, slug, count
 

+ 0 - 9
assets/javascripts/templates/error_tmpl.js

@@ -1,12 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS205: Consider reworking code to avoid use of IIFEs
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 const error = function (title, text, links) {
   if (text == null) {
     text = "";

+ 0 - 7
assets/javascripts/templates/notice_tmpl.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 const notice = (text) => `<p class="_notice-text">${text}</p>`;
 
 app.templates.singleDocNotice = (doc) =>

+ 2 - 10
assets/javascripts/templates/notif_tmpl.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS101: Remove unnecessary use of Array.from
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 const notif = function (title, html) {
   html = html.replace(/<a /g, '<a class="_notif-link" ');
   return ` <h5 class="_notif-title">${title}</h5>
@@ -70,7 +62,7 @@ app.templates.notifUpdates = function (docs, disabledDocs) {
   if (docs.length > 0) {
     html += '<div class="_news-row">';
     html += '<ul class="_notif-list">';
-    for (doc of Array.from(docs)) {
+    for (doc of docs) {
       html += `<li>${doc.name}`;
       if (doc.release) {
         html += ` <code>&rarr;</code> ${doc.release}`;
@@ -82,7 +74,7 @@ app.templates.notifUpdates = function (docs, disabledDocs) {
   if (disabledDocs.length > 0) {
     html += '<div class="_news-row"><p class="_news-title">Disabled:';
     html += '<ul class="_notif-list">';
-    for (doc of Array.from(disabledDocs)) {
+    for (doc of disabledDocs) {
       html += `<li>${doc.name}`;
       if (doc.release) {
         html += ` <code>&rarr;</code> ${doc.release}`;

+ 0 - 5
assets/javascripts/templates/pages/news_tmpl.js.erb

@@ -1,8 +1,3 @@
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 //= depend_on news.json
 
 app.templates.newsPage = () => ` <h1 class="_lined-heading">Changelog</h1>

+ 0 - 7
assets/javascripts/templates/pages/offline_tmpl.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.templates.offlinePage = (docs) => `\
 <h1 class="_lined-heading">Offline Documentation</h1>
 

+ 0 - 7
assets/javascripts/templates/pages/settings_tmpl.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 const themeOption = ({ label, value }, settings) => `\
 <label class="_settings-label _theme-label">
   <input type="radio" name="theme" value="${value}"${

+ 9 - 15
assets/javascripts/templates/pages/type_tmpl.js

@@ -1,17 +1,11 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-app.templates.typePage = (type) => ` <h1>${type.doc.fullName} / ${
-  type.name
-}</h1>
+app.templates.typePage = (type) => {
+  return ` <h1>${type.doc.fullName} / ${type.name}</h1>
 <ul class="_entry-list">${app.templates.render(
-  "typePageEntry",
-  type.entries(),
-)}</ul> `;
+    "typePageEntry",
+    type.entries(),
+  )}</ul> `;
+};
 
-app.templates.typePageEntry = (entry) =>
-  `<li><a href="${entry.fullPath()}">${$.escape(entry.name)}</a></li>`;
+app.templates.typePageEntry = (entry) => {
+  return `<li><a href="${entry.fullPath()}">${$.escape(entry.name)}</a></li>`;
+};

+ 0 - 8
assets/javascripts/templates/path_tmpl.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
 app.templates.path = function (doc, type, entry) {
   const arrow = '<svg class="_path-arrow"><use xlink:href="#icon-dir"/></svg>';
   let html = `<a href="${doc.fullPath()}" class="_path-item _icon-${

+ 0 - 8
assets/javascripts/templates/sidebar_tmpl.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 const { templates } = app;
 
 const arrow = '<svg class="_list-arrow"><use xlink:href="#icon-dir"/></svg>';

+ 0 - 7
assets/javascripts/templates/tip_tmpl.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.templates.tipKeyNav = () => `\
 <p class="_notif-text">
   <strong>ProTip</strong>

+ 0 - 8
assets/javascripts/views/content/static_page.js

@@ -1,11 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS206: Consider reworking classes to avoid initClass
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.views.StaticPage = class StaticPage extends app.View {
   static className = "_static";