From c9405fa2906de3b897e5328a0d4ff141589f4b25 Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:24 +0100 Subject: [PATCH] chore: add linter rules --- .eslintrc.js | 2 + src/App.vue | 14 +-- src/components/AppHeader.vue | 23 +++-- src/components/AppNav.vue | 70 +++++++++++---- src/components/AppView.vue | 3 +- src/components/LineIcon.vue | 2 +- src/components/LineMap/LineMap.vue | 12 +-- src/components/LineMap/LineMapDrawingCell.vue | 86 ++++++++++++++++--- src/components/LineMap/LineMapLabelCell.vue | 12 ++- src/components/LineMap/LineMapTable.vue | 24 ++++-- src/components/Stop/StopHeader.vue | 6 +- src/components/Stop/StopPrevNextStops.vue | 4 +- src/components/Stop/StopSchedules.vue | 44 ++++++---- .../Stop/StopSchedulesDetailsTimes.vue | 4 +- ...topSchedulesDetailsTimesNonStopPassage.vue | 6 +- src/components/Stop/StopSchedulesVisits.vue | 37 ++++++-- .../UiSchedulesDetailsTimeInline.vue | 4 +- .../UiSchedulesDetailsTimeWrapped.vue | 16 +++- src/components/ui/UiIcon.vue | 2 +- src/components/ui/UiTime.vue | 18 ++-- src/pages/SettingsPage.vue | 7 +- src/pages/TimetablesLinePage.vue | 2 +- src/pages/TimetablesStopPage.vue | 16 ++-- 23 files changed, 292 insertions(+), 122 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a87c751..8131582 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,8 @@ module.exports = { }, extends: [ 'plugin:vue/essential', + 'plugin:vue/strongly-recommended', + 'plugin:vue/recommended', '@vue/standard', '@vue/typescript/recommended', ], diff --git a/src/App.vue b/src/App.vue index 2b22203..5019586 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,13 +17,6 @@ export default Vue.extend({ components: { AppView, }, - created () { - if (!lastUpdatedAt()) { - synchronize().then(() => { - window.location.href = '/' - }) - } - }, watch: { '$route.params.tab': { handler () { @@ -71,6 +64,13 @@ export default Vue.extend({ immediate: true, }, }, + created () { + if (!lastUpdatedAt()) { + synchronize().then(() => { + window.location.href = '/' + }) + } + }, }) diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 25fa548..bb8e754 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -1,20 +1,27 @@ diff --git a/src/components/LineMap/LineMap.vue b/src/components/LineMap/LineMap.vue index fc1e8a7..567737a 100644 --- a/src/components/LineMap/LineMap.vue +++ b/src/components/LineMap/LineMap.vue @@ -1,7 +1,7 @@ @@ -20,6 +20,11 @@ export default Vue.extend({ data: () => ({ routeMap: [] as RouteMapType, }), + watch: { + line () { + this.update() + }, + }, created () { this.update() }, @@ -28,11 +33,6 @@ export default Vue.extend({ this.routeMap = getLineRouteMap(this.line) }, }, - watch: { - line () { - this.update() - }, - }, }) diff --git a/src/components/LineMap/LineMapDrawingCell.vue b/src/components/LineMap/LineMapDrawingCell.vue index 4104e9f..8b59a04 100644 --- a/src/components/LineMap/LineMapDrawingCell.vue +++ b/src/components/LineMap/LineMapDrawingCell.vue @@ -1,48 +1,108 @@