From 8ceb77a13a88034b3cbc6af5afa477068fb6c03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Sun, 16 Sep 2018 11:06:37 +0200 Subject: [PATCH] fix(templates): Add Vue ESLint config (algolia/create-instantsearch-app#240) * fix(templates): Add Vue ESLint config * test(snapshots): Update template snapshots --- scripts/__snapshots__/e2e-templates.test.js.snap | 15 +++++++++++---- src/templates/Vue InstantSearch/package.json | 1 + src/templates/Vue InstantSearch/src/App.vue | 16 +++++++++++----- src/templates/Vue InstantSearch/src/main.js | 1 + 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/scripts/__snapshots__/e2e-templates.test.js.snap b/scripts/__snapshots__/e2e-templates.test.js.snap index 6ad3d2c415..098bb88006 100644 --- a/scripts/__snapshots__/e2e-templates.test.js.snap +++ b/scripts/__snapshots__/e2e-templates.test.js.snap @@ -4411,16 +4411,22 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = ` 'ais-search-box__submit': 'ais-SearchBox-submit', 'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator', }\\" - > + /> @@ -4438,7 +4444,7 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = ` 'ais-pagination__item--last': 'ais-Pagination-item--last', 'ais-pagination__link': 'ais-Pagination-link', }\\" - > + /> @@ -4529,6 +4535,7 @@ import InstantSearch from 'vue-instantsearch'; Vue.use(InstantSearch); +// eslint-disable-next-line no-new new Vue({ el: '#app', render: h => h(App), diff --git a/src/templates/Vue InstantSearch/package.json b/src/templates/Vue InstantSearch/package.json index 6d8bf7ee13..9ae06b967c 100644 --- a/src/templates/Vue InstantSearch/package.json +++ b/src/templates/Vue InstantSearch/package.json @@ -26,6 +26,7 @@ "eslint-plugin-html": "4.0.5", "eslint-plugin-import": "2.14.0", "eslint-plugin-prettier": "2.6.2", + "eslint-plugin-vue": "4.7.1", "file-loader": "2.0.0", "prettier": "1.14.2", "vue-loader": "14.2.3", diff --git a/src/templates/Vue InstantSearch/src/App.vue b/src/templates/Vue InstantSearch/src/App.vue index b50f42f94f..9b2c6ae318 100644 --- a/src/templates/Vue InstantSearch/src/App.vue +++ b/src/templates/Vue InstantSearch/src/App.vue @@ -39,19 +39,25 @@ 'ais-search-box__submit': 'ais-SearchBox-submit', 'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator', }" - > + /> {{#if attributesToDisplay}} {{else}} - + {{/if}} diff --git a/src/templates/Vue InstantSearch/src/main.js b/src/templates/Vue InstantSearch/src/main.js index 00f3b8602a..76b80248e7 100644 --- a/src/templates/Vue InstantSearch/src/main.js +++ b/src/templates/Vue InstantSearch/src/main.js @@ -4,6 +4,7 @@ import InstantSearch from 'vue-instantsearch'; Vue.use(InstantSearch); +// eslint-disable-next-line no-new new Vue({ el: '#app', render: h => h(App),