From 7d23714e21b2e98f15ebd1f749d8f8a751d26db6 Mon Sep 17 00:00:00 2001 From: Malik Dirim Date: Tue, 5 May 2020 16:50:49 +0200 Subject: [PATCH 1/2] Fix linting errors in development environment --- .eslintrc.js | 8 +++++--- package.json | 5 +++-- src/Multiselect.vue | 1 + src/multiselectMixin.js | 2 +- src/pointerMixin.js | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c8f4a352..69443402 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,11 +2,13 @@ module.exports = { root: true, // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style extends: [ - 'standard' + 'standard', + 'plugin:vue/essential' ], - parser: 'babel-eslint', parserOptions: { - sourceType: 'module' + 'ecmaVersion': 2017, + 'sourceType': 'module', + 'parser': 'babel-eslint', }, // required to lint *.vue files plugins: ['html'], diff --git a/package.json b/package.json index 413a0d2b..c870c3ee 100644 --- a/package.json +++ b/package.json @@ -40,16 +40,17 @@ "connect-history-api-fallback": "^1.1.0", "copy-webpack-plugin": "^4.0.0", "cross-env": "^5.2.0", - "cssnano": "^4.1.7", "css-loader": "^0.28.11", + "cssnano": "^4.1.7", "es6-promise": "^4.2.4", - "eslint": "^6.4.0", + "eslint": "^6.8.0", "eslint-config-standard": "^6.1.0", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^2.2.1", "eslint-plugin-html": "^6.0.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^4.0.1", + "eslint-plugin-vue": "^6.2.2", "eventsource-polyfill": "^0.9.6", "express": "^4.16.3", "extract-text-webpack-plugin": "^2.0.0-rc.3", diff --git a/src/Multiselect.vue b/src/Multiselect.vue index 72abdfa2..f2eeb45d 100644 --- a/src/Multiselect.vue +++ b/src/Multiselect.vue @@ -341,6 +341,7 @@ export default { ? { width: '100%' } : { width: '0', position: 'absolute', padding: '0' } } + return '' }, contentStyle () { return this.options.length diff --git a/src/multiselectMixin.js b/src/multiselectMixin.js index 85323ef9..24c00ce2 100644 --- a/src/multiselectMixin.js +++ b/src/multiselectMixin.js @@ -571,7 +571,7 @@ export default { this.id ) } - + if (this.closeOnSelect) this.deactivate() }, /** diff --git a/src/pointerMixin.js b/src/pointerMixin.js index 4a967362..458c5f09 100644 --- a/src/pointerMixin.js +++ b/src/pointerMixin.js @@ -51,7 +51,7 @@ export default { return [ 'multiselect__option--disabled', { 'multiselect__option--group': selectedGroup.$isLabel } - ]; + ] } const group = this.options.find(option => { From 102cbe2010c0e7c1edffcde221922aa44998e244 Mon Sep 17 00:00:00 2001 From: Malik Dirim Date: Tue, 5 May 2020 18:09:03 +0200 Subject: [PATCH 2/2] Make index available in options list element --- src/Multiselect.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Multiselect.vue b/src/Multiselect.vue index f2eeb45d..d743f85d 100644 --- a/src/Multiselect.vue +++ b/src/Multiselect.vue @@ -119,7 +119,7 @@ :data-selected="selectedLabelText" :data-deselect="deselectLabelText" class="multiselect__option"> - + {{ getOptionLabel(option) }} @@ -131,7 +131,7 @@ @mouseenter.self="groupSelect && pointerSet(index)" @mousedown.prevent="selectGroup(option)" class="multiselect__option"> - + {{ getOptionLabel(option) }}