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!

Resolve lint errors

Alicia Sykesfdb0b9840e9c
diff --git a/src/components/Widgets/ChuckNorris.vue b/src/components/Widgets/ChuckNorris.vue
index 9f608a42..b194d48e 100644
--- a/src/components/Widgets/ChuckNorris.vue
+++ b/src/components/Widgets/ChuckNorris.vue
@@ -23,7 +23,7 @@ export default {
let usersChoice = this.options.categories;
if (!usersChoice) return '';
if (Array.isArray(usersChoice)) usersChoice = usersChoice.join(',');
- const categories = ["animal","career","celebrity","dev","explicit","fashion","food","history","money","movie","music","political","religion","science","sport","travel"];
+ const categories = ['animal', 'career', 'celebrity', 'dev', 'explicit', 'fashion', 'food', 'history', 'money', 'movie', 'music', 'political', 'religion', 'science', 'sport', 'travel'];
if (categories.some((cat) => usersChoice.toLowerCase().includes(cat))) return usersChoice;
return '';
},
@@ -49,7 +49,7 @@ export default {
},
/* Assign data variables to the returned data */
processData(data) {
- this.chuckNorrisLine = data.value;
+ this.chuckNorrisLine = data.value;
},
},
};
@@ -63,4 +63,4 @@ export default {
}
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/components/Widgets/CustomList.vue b/src/components/Widgets/CustomList.vue
index 8c99c3fd..086af05a 100644
--- a/src/components/Widgets/CustomList.vue
+++ b/src/components/Widgets/CustomList.vue
@@ -36,8 +36,8 @@ export default {
return this.options.title || '';
},
daysForNew() {
- return parseInt(Number(this.options.daysForNew)) || false;
- }
+ return parseInt(Number(this.options.daysForNew), 10) || false;
+ },
},
methods: {
fetchData() {
@@ -47,14 +47,14 @@ export default {
}
},
processData(data) {
- let today = new Date();
+ const today = new Date();
this.data = data.sort((a, b) => new Date(a.date) < new Date(b.date));
if (this.daysForNew) {
- let threshold = this.daysForNew * 1000 * 60 * 60 * 24;
- this.data = this.data.map((item) => {
- item.isNew = (today - new Date(item.date) < threshold);
- return item;
- });
+ const threshold = this.daysForNew * 1000 * 60 * 60 * 24;
+ this.data = this.data.map((item) => ({
+ ...item,
+ isNew: (today - new Date(item.date) < threshold),
+ }));
}
this.finishLoading();
},
diff --git a/src/components/Widgets/Flights.vue b/src/components/Widgets/Flights.vue
index 512fafc2..ef3e3873 100644
--- a/src/components/Widgets/Flights.vue
+++ b/src/components/Widgets/Flights.vue
@@ -137,12 +137,12 @@ export default {
flights.forEach((flight) => {
results.push({
number: flight.number,
- airline: flight.airline?.name ?? "unknown airline",
- aircraft: flight.aircraft?.model ?? "unknown aircraft",
- airport: flight.movement?.airport?.name ?? "unknown airport",
+ airline: flight.airline?.name ?? 'unknown airline',
+ aircraft: flight.aircraft?.model ?? 'unknown aircraft',
+ airport: flight.movement?.airport?.name ?? 'unknown airport',
time: flight.movement
- ? (flight.movement?.revisedTime?.local ?? flight.movement?.scheduledTime?.local ?? "unknown time")
- : "unknown time"
+ ? (flight.movement?.revisedTime?.local ?? flight.movement?.scheduledTime?.local ?? 'unknown time')
+ : 'unknown time',
});
});
return results;
diff --git a/src/components/Widgets/PiHoleTrafficV6.vue b/src/components/Widgets/PiHoleTrafficV6.vue
index 5a59eb04..aa0b02f9 100644
--- a/src/components/Widgets/PiHoleTrafficV6.vue
+++ b/src/components/Widgets/PiHoleTrafficV6.vue
@@ -81,7 +81,7 @@ export default {
return this.makeRequest(this.historyEndpoint, this.authHeader);
},
validate(data) {
- if (!data || !Array.isArray(data['history'])) {
+ if (!data || !Array.isArray(data.history)) {
this.error('Got success, but found no results, possible authorization error');
} else if (data.history.length < 1) {
this.error('Request completed succesfully, but no data in Pi-Hole yet');