Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ”₯ Remove all eslint-ignore comments, may fail

Alicia Sykesb17eb8062480
diff --git a/src/components/Configuration/ConfigContainer.vue b/src/components/Configuration/ConfigContainer.vue
index cd72c153..dfaed222 100644
--- a/src/components/Configuration/ConfigContainer.vue
+++ b/src/components/Configuration/ConfigContainer.vue
@@ -198,7 +198,7 @@ export default {
resetLocalSettings() {
const msg = `${this.$t('config.reset-config-msg-l1')} `
+ `${this.$t('config.reset-config-msg-l2')}\n\n${this.$t('config.reset-config-msg-l3')}`;
- const isTheUserSure = confirm(msg); // eslint-disable-line no-alert, no-restricted-globals
+ const isTheUserSure = confirm(msg);
if (isTheUserSure) {
clearScopedLocalConfig(this.$store.getters.pages);
this.$toast(this.$t('config.data-cleared-msg'));
diff --git a/src/components/Configuration/CustomCss.vue b/src/components/Configuration/CustomCss.vue
index 69f6fb43..5faf5581 100644
--- a/src/components/Configuration/CustomCss.vue
+++ b/src/components/Configuration/CustomCss.vue
@@ -81,7 +81,7 @@ export default {
},
/* Reload the page (only called if removing styles) */
reloadPage() {
- setTimeout(() => { location.reload(); }, 1500); // eslint-disable-line no-restricted-globals
+ setTimeout(() => { location.reload(); }, 1500);
},
/* Show success toast and lot update */
showSuccessMsg() {
diff --git a/src/components/Configuration/EditSiteMeta.vue b/src/components/Configuration/EditSiteMeta.vue
index 6d01bf53..90b3a481 100644
--- a/src/components/Configuration/EditSiteMeta.vue
+++ b/src/components/Configuration/EditSiteMeta.vue
@@ -65,7 +65,7 @@ export default {
}
localStorage.setItem(localStorageKeys.PAGE_INFO, JSON.stringify(pageInfo));
this.$toast('Changes saved successfully');
- setTimeout(() => { location.reload(); }, 1500); // eslint-disable-line no-restricted-globals
+ setTimeout(() => { location.reload(); }, 1500);
},
addNavLinkRow() {
this.formElements.navLinks.push({ title: '', path: '' });
diff --git a/src/components/Configuration/JsonEditor.vue b/src/components/Configuration/JsonEditor.vue
index 108828d7..a403d76e 100644
--- a/src/components/Configuration/JsonEditor.vue
+++ b/src/components/Configuration/JsonEditor.vue
@@ -332,7 +332,7 @@ export default {
onSaveLocally() {
const data = this.parseCurrent();
if (data == null) return;
- // eslint-disable-next-line no-alert, no-restricted-globals
+
if (!confirm(this.$t('interactive-editor.menu.save-locally-warning'))) return;
this.saveConfigLocally(data);
this.applyConfigToStore(data);
@@ -354,7 +354,7 @@ export default {
const dirty = this.view.state.doc.toString() !== this.initialDoc;
const inPreview = this.$store.state.editMode;
if (!dirty && !inPreview) return;
- // eslint-disable-next-line no-alert, no-restricted-globals
+
if (!confirm(this.$t('config-editor.reset-confirm-msg'))) return;
if (dirty) {
this.view.dispatch({
diff --git a/src/components/Configuration/RebuildApp.vue b/src/components/Configuration/RebuildApp.vue
index 740022c8..db3651e1 100644
--- a/src/components/Configuration/RebuildApp.vue
+++ b/src/components/Configuration/RebuildApp.vue
@@ -115,7 +115,7 @@ export default {
);
},
refreshPage() {
- location.reload(); // eslint-disable-line no-restricted-globals
+ location.reload();
},
},
mounted() {
diff --git a/src/components/InteractiveEditor/EditModeSaveMenu.vue b/src/components/InteractiveEditor/EditModeSaveMenu.vue
index 74fd49be..b7ab2dd3 100644
--- a/src/components/InteractiveEditor/EditModeSaveMenu.vue
+++ b/src/components/InteractiveEditor/EditModeSaveMenu.vue
@@ -192,7 +192,7 @@ export default {
},
saveLocally() {
const msg = this.$t('interactive-editor.menu.save-locally-warning');
- const youSure = confirm(msg); // eslint-disable-line no-alert, no-restricted-globals
+ const youSure = confirm(msg);
if (youSure) {
this.saveConfigLocally(this.configToSave);
}
diff --git a/src/components/LinkItems/ItemIcon.vue b/src/components/LinkItems/ItemIcon.vue
index dbed7ebf..21a9665a 100644
--- a/src/components/LinkItems/ItemIcon.vue
+++ b/src/components/LinkItems/ItemIcon.vue
@@ -78,7 +78,7 @@ export default {
methods: {
/* Determine icon type, e.g. local or remote asset, SVG, favicon, font-awesome, etc */
determineImageType(img) {
- let imgType = '';
+ let imgType;
if (!img) imgType = 'none';
else if (this.isUrl(img)) imgType = 'url';
else if (this.isImage(img)) imgType = 'img';
@@ -173,7 +173,7 @@ export default {
},
/* Get the URL for a favicon, but using the non-default favicon API */
getCustomFavicon(fullUrl, faviconIdentifier) {
- let errorMsg = '';
+ let errorMsg;
const faviconApi = faviconIdentifier.split('favicon-')[1];
if (!faviconApi) {
errorMsg = 'Favicon API not specified';
@@ -243,7 +243,7 @@ export default {
},
/* Called when the path to the image cannot be resolved */
imageNotFound(errorMsg) {
- let outputMessage = '';
+ let outputMessage;
if (errorMsg && typeof errorMsg === 'string') {
outputMessage = errorMsg;
} else if (!this.icon) {
diff --git a/src/components/LinkItems/Section.vue b/src/components/LinkItems/Section.vue
index de9efaa0..5f6e2d4d 100644
--- a/src/components/LinkItems/Section.vue
+++ b/src/components/LinkItems/Section.vue
@@ -235,7 +235,7 @@ export default {
/* Deletes current section, in local state */
removeSection() {
const confirmMsg = this.$t('interactive-editor.edit-section.remove-confirm');
- const youSure = confirm(confirmMsg); // eslint-disable-line no-alert, no-restricted-globals
+ const youSure = confirm(confirmMsg);
if (youSure) {
const payload = { sectionIndex: this.index, sectionName: this.title };
this.$store.commit(StoreKeys.REMOVE_SECTION, payload);
diff --git a/src/components/Settings/LocalConfigWarning.vue b/src/components/Settings/LocalConfigWarning.vue
index a40d748b..b4b1c5f8 100644
--- a/src/components/Settings/LocalConfigWarning.vue
+++ b/src/components/Settings/LocalConfigWarning.vue
@@ -51,7 +51,7 @@ export default {
resetLocalConfig() {
const msg = `${this.$t('config.reset-config-msg-l1')} `
+ `${this.$t('config.reset-config-msg-l2')}\n\n${this.$t('config.reset-config-msg-l3')}`;
- const isTheUserSure = confirm(msg); // eslint-disable-line no-alert, no-restricted-globals
+ const isTheUserSure = confirm(msg);
if (isTheUserSure) {
clearScopedLocalConfig(this.$store.getters.pages);
this.$toast(this.$t('config.data-cleared-msg'));
diff --git a/src/components/Widgets/GlCpuTemp.vue b/src/components/Widgets/GlCpuTemp.vue
index bb11ce74..1e955a82 100644
--- a/src/components/Widgets/GlCpuTemp.vue
+++ b/src/components/Widgets/GlCpuTemp.vue
@@ -91,7 +91,7 @@ export default {
default:
// Justification: This is a recoverable error that developers
// should nevertheless be warned about.
- // eslint-disable-next-line
+
console.warn('Unrecognized unit', sensor.unit);
return null;
}
diff --git a/src/components/Widgets/GlNetworkTraffic.vue b/src/components/Widgets/GlNetworkTraffic.vue
index 321b6c2a..f2da0e5c 100644
--- a/src/components/Widgets/GlNetworkTraffic.vue
+++ b/src/components/Widgets/GlNetworkTraffic.vue
@@ -30,7 +30,7 @@ export default {
upload: [],
download: [],
};
- /* eslint-disable prefer-destructuring */
+
Object.keys(trafficData).forEach((keyName) => {
let upOrDown = null;
if (keyName.includes('_sent')) upOrDown = 'up';
diff --git a/src/main.js b/src/main.js
index 0d8ceb03..a8d538f1 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-multi-spaces */
+
// Import core framework and essential utils
import { createApp } from 'vue';
diff --git a/src/router.js b/src/router.js
index af156d9c..bd2b0fe1 100644
--- a/src/router.js
+++ b/src/router.js
@@ -136,7 +136,7 @@ router.beforeEach(async (to, from, next) => {
// If in edit mode and navigating to a DIFFERENT page, confirm + cancel edit.
const pageChanged = from.params?.page !== to.params?.page;
if (store.state.editMode && pageChanged) {
- // eslint-disable-next-line no-alert, no-restricted-globals
+
const ok = confirm(i18n.global.t('interactive-editor.menu.leave-while-editing-confirm'));
if (!ok) {
progress.end();
diff --git a/src/store.js b/src/store.js
index ad5fe2ac..76d58d9e 100644
--- a/src/store.js
+++ b/src/store.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-param-reassign, prefer-destructuring */
+
import { createStore } from 'vuex';
import yaml from 'js-yaml';
import request from '@/utils/request';
@@ -245,7 +245,7 @@ const store = createStore({
void state.authRevision; // Re-evaluate when auth state changes
return getUserState();
},
- // eslint-disable-next-line arrow-body-style
+
getSectionByIndex: (state, getters) => (index) => {
return getters.sections[index];
},
diff --git a/src/utils/MiscHelpers.js b/src/utils/MiscHelpers.js
index dc8863ff..1e81cf9f 100644
--- a/src/utils/MiscHelpers.js
+++ b/src/utils/MiscHelpers.js
@@ -1,5 +1,5 @@
/* A collection of generic reusable functions for various string processing tasks */
-/* eslint-disable arrow-body-style */
+
/* Very rudimentary hash function for generative icons */
export const asciiHash = (input) => {
diff --git a/src/utils/auth/HeaderAuth.js b/src/utils/auth/HeaderAuth.js
index 758fb344..e16c0bbb 100644
--- a/src/utils/auth/HeaderAuth.js
+++ b/src/utils/auth/HeaderAuth.js
@@ -51,7 +51,7 @@ class HeaderAuth {
});
}
- // eslint-disable-next-line class-methods-use-this
+
logout() {
authLogout();
}
diff --git a/src/utils/config/ConfigAccumalator.js b/src/utils/config/ConfigAccumalator.js
index 96063972..60954733 100644
--- a/src/utils/config/ConfigAccumalator.js
+++ b/src/utils/config/ConfigAccumalator.js
@@ -61,7 +61,7 @@ export default class ConfigAccumulator {
pageInfo() {
let localPageInfo = {};
if (localStorage[localStorageKeys.PAGE_INFO]) {
- // eslint-disable-next-line brace-style
+
try { localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]); }
catch (e) { ErrorHandler('Malformed pageInfo data in local storage'); }
}
diff --git a/src/views/Login.vue b/src/views/Login.vue
index ee9c8168..6375df01 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -193,7 +193,7 @@ export default {
},
/* Refreshes the page */
refreshPage() {
- setTimeout(() => { location.reload(); }, 250); // eslint-disable-line no-restricted-globals
+ setTimeout(() => { location.reload(); }, 250);
},
/* Redirects to the homepage */
goHome() {
@@ -203,7 +203,7 @@ export default {
},
},
created() {
- setTimeout(() => { this.timeout = this.dropDownMenu[0]; }, 1); //eslint-disable-line
+ setTimeout(() => { this.timeout = this.dropDownMenu[0]; }, 1);
},
};