From adfebd0167d89b69d6b40686d6c9fb6a5b13017e Mon Sep 17 00:00:00 2001 From: An Phan Date: Sat, 26 Nov 2016 10:25:35 +0700 Subject: [PATCH] Lint everything --- .eslintignore | 2 + .eslintrc | 6 + package.json | 5 +- resources/assets/js/app.vue | 144 +++++----- .../assets/js/components/auth/login-form.vue | 30 +- .../main-wrapper/extra/album-info.vue | 34 +-- .../main-wrapper/extra/artist-info.vue | 32 +-- .../components/main-wrapper/extra/index.vue | 63 +++-- .../components/main-wrapper/extra/lyrics.vue | 4 +- .../components/main-wrapper/extra/youtube.vue | 35 ++- .../js/components/main-wrapper/index.vue | 10 +- .../main-wrapper/main-content/album.vue | 70 ++--- .../main-wrapper/main-content/albums.vue | 44 +-- .../main-wrapper/main-content/artist.vue | 62 ++--- .../main-wrapper/main-content/artists.vue | 44 +-- .../main-wrapper/main-content/favorites.vue | 24 +- .../main-wrapper/main-content/home.vue | 60 ++-- .../main-wrapper/main-content/index.vue | 52 ++-- .../main-wrapper/main-content/playlist.vue | 60 ++-- .../main-wrapper/main-content/profile.vue | 53 ++-- .../main-wrapper/main-content/queue.vue | 34 +-- .../main-wrapper/main-content/settings.vue | 54 ++-- .../main-wrapper/main-content/songs.vue | 17 +- .../main-wrapper/main-content/users.vue | 28 +- .../main-content/youtube-player.vue | 36 +-- .../components/main-wrapper/sidebar/index.vue | 66 ++--- .../main-wrapper/sidebar/playlist-item.vue | 94 +++---- .../main-wrapper/sidebar/playlists.vue | 28 +- .../js/components/modals/edit-songs-form.vue | 168 +++++------ .../js/components/shared/add-to-menu.vue | 46 ++-- .../js/components/shared/album-item.vue | 56 ++-- .../js/components/shared/artist-item.vue | 48 ++-- .../js/components/shared/home-song-item.vue | 32 +-- .../assets/js/components/shared/overlay.vue | 40 +-- .../assets/js/components/shared/song-item.vue | 58 ++-- .../shared/song-list-controls-toggler.vue | 8 +- .../components/shared/song-list-controls.vue | 47 ++-- .../assets/js/components/shared/song-list.vue | 260 +++++++++--------- .../assets/js/components/shared/song-menu.vue | 124 ++++----- .../assets/js/components/shared/sound-bar.vue | 2 +- .../js/components/shared/to-top-button.vue | 4 +- .../assets/js/components/shared/typeahead.vue | 98 +++---- .../assets/js/components/shared/user-item.vue | 60 ++-- .../js/components/shared/view-mode-switch.vue | 40 +-- .../js/components/site-footer/equalizer.vue | 146 +++++----- .../js/components/site-footer/index.vue | 87 +++--- .../js/components/site-footer/volume.vue | 28 +- .../js/components/site-header/index.vue | 28 +- .../js/components/site-header/search-form.vue | 30 +- .../js/components/site-header/user-badge.vue | 20 +- resources/assets/js/config/index.js | 4 +- resources/assets/js/directives/clickaway.js | 12 +- resources/assets/js/directives/focus.js | 10 +- resources/assets/js/directives/index.js | 4 +- resources/assets/js/main.js | 16 +- resources/assets/js/mixins/has-song-list.js | 44 +-- resources/assets/js/mixins/infinite-scroll.js | 42 +-- .../assets/js/mixins/song-menu-methods.js | 55 ++-- resources/assets/js/router.js | 114 ++++---- resources/assets/js/services/download.js | 54 ++-- resources/assets/js/services/http.js | 50 ++-- resources/assets/js/services/index.js | 12 +- resources/assets/js/services/info/album.js | 36 +-- resources/assets/js/services/info/artist.js | 28 +- resources/assets/js/services/info/index.js | 6 +- resources/assets/js/services/info/song.js | 28 +- resources/assets/js/services/ls.js | 20 +- resources/assets/js/services/playback.js | 241 ++++++++-------- resources/assets/js/services/youtube.js | 31 +-- resources/assets/js/stores/album.js | 122 ++++---- resources/assets/js/stores/artist.js | 136 ++++----- resources/assets/js/stores/equalizer.js | 44 +-- resources/assets/js/stores/favorite.js | 64 +++-- resources/assets/js/stores/index.js | 22 +- resources/assets/js/stores/playlist.js | 106 +++---- resources/assets/js/stores/preference.js | 50 ++-- resources/assets/js/stores/queue.js | 104 +++---- resources/assets/js/stores/setting.js | 24 +- resources/assets/js/stores/shared.js | 78 +++--- resources/assets/js/stores/song.js | 210 +++++++------- resources/assets/js/stores/user.js | 131 ++++----- resources/assets/js/stubs/album.js | 8 +- resources/assets/js/stubs/artist.js | 4 +- resources/assets/js/stubs/playlist.js | 4 +- resources/assets/js/stubs/settings.js | 4 +- resources/assets/js/stubs/song.js | 8 +- resources/assets/js/stubs/user.js | 4 +- .../assets/js/tests/blobs/interactions.js | 12 +- resources/assets/js/tests/blobs/media.js | 124 ++++----- resources/assets/js/tests/blobs/users.js | 10 +- resources/assets/js/tests/helper.js | 14 +- resources/assets/js/tests/services/lsTest.js | 41 +-- resources/assets/js/tests/stores/albumTest.js | 102 +++---- .../assets/js/tests/stores/artistTest.js | 80 +++--- .../assets/js/tests/stores/preferenceTest.js | 40 +-- resources/assets/js/tests/stores/queueTest.js | 120 ++++---- resources/assets/js/tests/stores/songTest.js | 138 +++++----- resources/assets/js/tests/stores/userTest.js | 72 ++--- resources/assets/js/tests/utils/allTest.js | 34 +-- resources/assets/js/utils/common.js | 42 +-- resources/assets/js/utils/filters.js | 68 ++--- resources/assets/js/utils/formatters.js | 30 +- resources/assets/js/utils/index.js | 8 +- resources/assets/js/utils/supports.js | 48 ++-- 104 files changed, 2770 insertions(+), 2764 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..e184eaef --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +libs +tests diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..bcad5c39 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "vue", + "rules": { + "no-multi-str": "off" + } +} diff --git a/package.json b/package.json index a1402228..36dc2f3e 100644 --- a/package.json +++ b/package.json @@ -50,13 +50,16 @@ "browserify-hmr": "^0.3.1", "chai": "^3.4.1", "chalk": "^1.1.3", + "eslint": "^3.10.2", + "eslint-config-vue": "^2.0.1", + "eslint-plugin-vue": "^1.0.0", "jsdom": "^9.2.1", "mocha": "^2.3.4", "sinon": "^1.17.2" }, "scripts": { "postinstall": "cross-env NODE_ENV=production && gulp --production", - "test": "mocha --compilers js:babel-register --require resources/assets/js/tests/helper.js resources/assets/js/tests/**/*Test.js", + "test": "eslint resources/assets/js --ext=js,vue && mocha --compilers js:babel-register --require resources/assets/js/tests/helper.js resources/assets/js/tests/**/*Test.js", "e2e": "gulp e2e" } } diff --git a/resources/assets/js/app.vue b/resources/assets/js/app.vue index d87e7812..24e050f5 100644 --- a/resources/assets/js/app.vue +++ b/resources/assets/js/app.vue @@ -23,77 +23,79 @@ diff --git a/resources/assets/js/components/shared/song-list.vue b/resources/assets/js/components/shared/song-list.vue index f660776c..74ead96a 100644 --- a/resources/assets/js/components/shared/song-list.vue +++ b/resources/assets/js/components/shared/song-list.vue @@ -50,17 +50,17 @@