From 92d61a23af1f3bc17551e42995ce2d0f1e584351 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 8 Oct 2021 19:52:51 +0100 Subject: [PATCH] Make eslint work, and fix all warnings. (#511) * Make eslint work, and fix all warnings. * Don't ignore v-html rule globally. * Remove eslint file and merge in package.json. --- babel.config.js | 6 +- package.json | 3 + src/App.vue | 2 +- src/components/Channel.vue | 21 ++-- src/components/Comment.vue | 81 +++++++------ src/components/ErrorHandler.vue | 4 +- src/components/FeedPage.vue | 34 +++--- src/components/HistoryPage.vue | 21 ++-- src/components/ImportPage.vue | 6 +- src/components/LoginPage.vue | 7 +- src/components/Navigation.vue | 18 +-- src/components/Player.vue | 168 ++++++++++++++------------- src/components/Playlist.vue | 28 ++--- src/components/Preferences.vue | 99 ++++++++-------- src/components/RegisterPage.vue | 7 +- src/components/SearchResults.vue | 26 +++-- src/components/SearchSuggestions.vue | 5 +- src/components/SubscriptionsPage.vue | 41 +++---- src/components/TrendingPage.vue | 12 +- src/components/VideoItem.vue | 24 ++-- src/components/WatchVideo.vue | 103 ++++++++-------- src/main.js | 2 +- vue.config.js | 32 ++--- yarn.lock | 24 ++++ 24 files changed, 412 insertions(+), 362 deletions(-) diff --git a/babel.config.js b/babel.config.js index e9558405..6431b568 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,3 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} + presets: ["@vue/cli-plugin-babel/preset"], +}; diff --git a/package.json b/package.json index e92bc45b..c4ddaa17 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "@vue/compiler-sfc": "3.2.19", "babel-eslint": "^10.1.0", "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-vue": "^7.19.1" }, "eslintConfig": { @@ -43,6 +45,7 @@ }, "extends": [ "plugin:vue/vue3-essential", + "plugin:prettier/recommended", "eslint:recommended" ], "parserOptions": { diff --git a/src/App.vue b/src/App.vue index f215f248..28803eaa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,7 +7,7 @@ - + diff --git a/src/components/Channel.vue b/src/components/Channel.vue index 780b7558..fe244e51 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -3,17 +3,18 @@

- {{ channel.name }} + {{ channel.name }}

- + +

@@ -22,11 +23,11 @@
- +
@@ -37,6 +38,10 @@ import ErrorHandler from "@/components/ErrorHandler.vue"; import VideoItem from "@/components/VideoItem.vue"; export default { + components: { + ErrorHandler, + VideoItem, + }, data() { return { channel: null, @@ -116,9 +121,5 @@ export default { this.subscribed = !this.subscribed; }, }, - components: { - ErrorHandler, - VideoItem, - }, }; diff --git a/src/components/Comment.vue b/src/components/Comment.vue index 660ca7b0..06987f9a 100644 --- a/src/components/Comment.vue +++ b/src/components/Comment.vue @@ -1,47 +1,52 @@ \ No newline at end of file + comment: { + type: Object, + default: () => { + return {}; + }, + }, + uploader: { type: String, default: null }, + }, +}; + diff --git a/src/components/ErrorHandler.vue b/src/components/ErrorHandler.vue index 988559c8..bfda08c8 100644 --- a/src/components/ErrorHandler.vue +++ b/src/components/ErrorHandler.vue @@ -9,8 +9,8 @@ diff --git a/src/components/FeedPage.vue b/src/components/FeedPage.vue index 2e58174e..278699ad 100644 --- a/src/components/FeedPage.vue +++ b/src/components/FeedPage.vue @@ -1,12 +1,12 @@