From f18f01a0475e2ae97664824a5ff0ad2c11cb605e Mon Sep 17 00:00:00 2001 From: Pranav Raj Sreepuram Date: Sun, 25 Aug 2019 11:04:33 +0530 Subject: [PATCH] Fix eslint warnings, update eslint config --- .eslintrc.js | 74 +++++---- app/javascript/packs/application.js | 2 +- .../src/components/layout/SidebarItem.vue | 54 +++++-- .../src/components/widgets/ChatTypeTabs.vue | 33 ++-- .../widgets/conversation/ConversationBox.vue | 145 +++++++++++------- .../dashboard/settings/inbox/ChannelList.vue | 21 +-- .../dashboard/settings/reports/Index.vue | 26 ++-- package.json | 4 +- 8 files changed, 227 insertions(+), 132 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6d369e983..599c6d269 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,37 +1,47 @@ module.exports = { - "extends": ["airbnb/base", "prettier"], - "plugins": [ - "prettier", "babel", "html" - ], - "rules": { - "prettier/prettier": ["error"], - "camelcase": "off", - "import/no-extraneous-dependencies": "off", - "import/prefer-default-export": "off", - "import/no-named-as-default": "off", - "jsx-a11y/no-static-element-interactions": "off", - "jsx-a11y/click-events-have-key-events": "off", - "jsx-a11y/label-has-associated-control": "off", - "jsx-a11y/label-has-for": "off", - "jsx-a11y/anchor-is-valid": "off", - 'import/no-unresolved': "off", + extends: ['airbnb/base', 'prettier', 'plugin:vue/recommended'], + parserOptions: { + parser: 'babel-eslint', + ecmaVersion: 2017, + sourceType: 'module', }, - "settings": { - "import/resolver": { - "webpack": { - "config": "config/webpack/resolve.js" + plugins: ['html', 'prettier', 'babel'], + rules: { + 'prettier/prettier': ['error'], + camelcase: 'off', + 'import/no-extraneous-dependencies': 'off', + 'import/prefer-default-export': 'off', + 'import/no-named-as-default': 'off', + 'jsx-a11y/no-static-element-interactions': 'off', + 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/label-has-associated-control': 'off', + 'jsx-a11y/label-has-for': 'off', + 'jsx-a11y/anchor-is-valid': 'off', + 'import/no-unresolved': 'off', + 'vue/max-attributes-per-line': ['error', { + 'singleline': 3, + 'multiline': { + 'max': 1, + 'allowFirstLine': false } - } + }], + 'vue/html-self-closing': false }, - "env": { - "browser": true, - "node": true, - "jest": true + settings: { + 'import/resolver': { + webpack: { + config: 'config/webpack/resolve.js', + }, + }, }, - "parser": "babel-eslint", - "globals": { - "__WEBPACK_ENV__": true, - "__PUSHER__": true, - "__FB_APP_ID__": true - } -} + env: { + browser: true, + node: true, + jest: true, + }, + globals: { + __WEBPACK_ENV__: true, + __PUSHER__: true, + __FB_APP_ID__: true, + }, +}; diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 5f8188c40..d2b1e86d7 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -53,8 +53,8 @@ window.onload = () => { window.WOOT = new Vue({ router, store, - template: '', components: { App }, + template: '', }).$mount('#app'); }; window.pusher = vuePusher.init(); diff --git a/app/javascript/src/components/layout/SidebarItem.vue b/app/javascript/src/components/layout/SidebarItem.vue index eaf2361da..c48998ba8 100644 --- a/app/javascript/src/components/layout/SidebarItem.vue +++ b/app/javascript/src/components/layout/SidebarItem.vue @@ -1,20 +1,34 @@ @@ -23,26 +27,23 @@ export default { }, data() { return { - channelList: [ - 'facebook', - 'twitter', - 'telegram', - 'line', - ], + channelList: ['facebook', 'twitter', 'telegram', 'line'], }; }, created() { - bus.$on('channelItemClick', (channel) => { + bus.$on('channelItemClick', channel => { this.initChannelAuth(channel); }); }, methods: { initChannelAuth(channel) { if (channel === 'facebook') { - router.push({ name: 'settings_inboxes_page_channel', params: { page: 'new', sub_page: 'facebook' } }); + router.push({ + name: 'settings_inboxes_page_channel', + params: { page: 'new', sub_page: 'facebook' }, + }); } }, }, }; - diff --git a/app/javascript/src/routes/dashboard/settings/reports/Index.vue b/app/javascript/src/routes/dashboard/settings/reports/Index.vue index 027c6fa28..0d143de46 100644 --- a/app/javascript/src/routes/dashboard/settings/reports/Index.vue +++ b/app/javascript/src/routes/dashboard/settings/reports/Index.vue @@ -5,37 +5,41 @@ v-model="currentDateRangeSelection" track-by="name" label="name" - @select="changeDateSelection" placeholder="Select one" :options="dateRange" :searchable="false" :allow-empty="true" + @select="changeDateSelection" />
- +
- - + + + {{ $t('REPORT.NO_ENOUGH_DATA') }} +
-