From 51b394751d0ae6e8c48e411028af9d21b35bfbc4 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 8 Oct 2021 19:20:41 +0100 Subject: [PATCH] Make eslint work, and fix all warnings. --- .eslintrc.js | 6 + babel.config.js | 6 +- package.json | 2 + src/App.vue | 2 +- src/components/Channel.vue | 20 ++-- 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 | 90 +++++++------- src/main.js | 2 +- vue.config.js | 32 ++--- yarn.lock | 24 ++++ 25 files changed, 410 insertions(+), 355 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..4274d91d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ["plugin:vue/vue3-recommended", "plugin:prettier/recommended"], + rules: { + "vue/no-v-html": "off", + }, +}; 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..15e35380 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": { 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..45cc4df6 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -3,17 +3,17 @@

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

- +

@@ -22,11 +22,11 @@
- +
@@ -37,6 +37,10 @@ import ErrorHandler from "@/components/ErrorHandler.vue"; import VideoItem from "@/components/VideoItem.vue"; export default { + components: { + ErrorHandler, + VideoItem, + }, data() { return { channel: null, @@ -116,9 +120,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 @@