Skip to content

Commit

Permalink
fix(templates): Add Vue ESLint config (algolia/create-instantsearch-a…
Browse files Browse the repository at this point in the history
…pp#240)

* fix(templates): Add Vue ESLint config

* test(snapshots): Update template snapshots
  • Loading branch information
francoischalifour authored Sep 16, 2018
1 parent 205e4d0 commit 8ceb77a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
15 changes: 11 additions & 4 deletions scripts/__snapshots__/e2e-templates.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}\\"
></ais-search-box>
/>
<ais-results class=\\"ais-Hits-list\\">
<template slot-scope=\\"{ result }\\">
<article class=\\"ais-Hits-item\\">
<h1>
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute1\\"></ais-highlight>
<ais-highlight
:result=\\"result\\"
attribute-name=\\"attribute1\\"
/>
</h1>
<p>
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute2\\"></ais-highlight>
<ais-highlight
:result=\\"result\\"
attribute-name=\\"attribute2\\"
/>
</p>
</article>
</template>
Expand All @@ -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',
}\\"
></ais-pagination>
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/templates/Vue InstantSearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 11 additions & 5 deletions src/templates/Vue InstantSearch/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,33 @@
'ais-search-box__submit': 'ais-SearchBox-submit',
'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator',
}"
></ais-search-box>
/>

{{#if attributesToDisplay}}
<ais-results class="ais-Hits-list">
<template slot-scope="{ result }">
<article class="ais-Hits-item">
<h1>
<ais-highlight :result="result" attribute-name="{{attributesToDisplay.[0]}}"></ais-highlight>
<ais-highlight
:result="result"
attribute-name="{{attributesToDisplay.[0]}}"
/>
</h1>
{{#each attributesToDisplay}}
{{#unless @first}}
<p>
<ais-highlight :result="result" attribute-name="{{this}}"></ais-highlight>
<ais-highlight
:result="result"
attribute-name="{{this}}"
/>
</p>
{{/unless}}
{{/each}}
</article>
</template>
</ais-results>
{{else}}
<ais-results class="ais-Hits-list"></ais-results>
<ais-results class="ais-Hits-list" />
{{/if}}

<div class="pagination">
Expand All @@ -74,7 +80,7 @@
'ais-pagination__item--last': 'ais-Pagination-item--last',
'ais-pagination__link': 'ais-Pagination-link',
}"
></ais-pagination>
/>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/templates/Vue InstantSearch/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 8ceb77a

Please sign in to comment.