Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit c1a5ecf

Browse files
fix(templates): Add Vue ESLint config (#240)
* fix(templates): Add Vue ESLint config * test(snapshots): Update template snapshots
1 parent 2b9eadf commit c1a5ecf

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

scripts/__snapshots__/e2e-templates.test.js.snap

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4411,16 +4411,22 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = `
44114411
'ais-search-box__submit': 'ais-SearchBox-submit',
44124412
'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator',
44134413
}\\"
4414-
></ais-search-box>
4414+
/>
44154415
44164416
<ais-results class=\\"ais-Hits-list\\">
44174417
<template slot-scope=\\"{ result }\\">
44184418
<article class=\\"ais-Hits-item\\">
44194419
<h1>
4420-
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute1\\"></ais-highlight>
4420+
<ais-highlight
4421+
:result=\\"result\\"
4422+
attribute-name=\\"attribute1\\"
4423+
/>
44214424
</h1>
44224425
<p>
4423-
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute2\\"></ais-highlight>
4426+
<ais-highlight
4427+
:result=\\"result\\"
4428+
attribute-name=\\"attribute2\\"
4429+
/>
44244430
</p>
44254431
</article>
44264432
</template>
@@ -4438,7 +4444,7 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = `
44384444
'ais-pagination__item--last': 'ais-Pagination-item--last',
44394445
'ais-pagination__link': 'ais-Pagination-link',
44404446
}\\"
4441-
></ais-pagination>
4447+
/>
44424448
</div>
44434449
</div>
44444450
</div>
@@ -4529,6 +4535,7 @@ import InstantSearch from 'vue-instantsearch';
45294535
45304536
Vue.use(InstantSearch);
45314537
4538+
// eslint-disable-next-line no-new
45324539
new Vue({
45334540
el: '#app',
45344541
render: h => h(App),

src/templates/Vue InstantSearch/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"eslint-plugin-html": "4.0.5",
2727
"eslint-plugin-import": "2.14.0",
2828
"eslint-plugin-prettier": "2.6.2",
29+
"eslint-plugin-vue": "4.7.1",
2930
"file-loader": "2.0.0",
3031
"prettier": "1.14.2",
3132
"vue-loader": "14.2.3",

src/templates/Vue InstantSearch/src/App.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,33 @@
3939
'ais-search-box__submit': 'ais-SearchBox-submit',
4040
'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator',
4141
}"
42-
></ais-search-box>
42+
/>
4343

4444
{{#if attributesToDisplay}}
4545
<ais-results class="ais-Hits-list">
4646
<template slot-scope="{ result }">
4747
<article class="ais-Hits-item">
4848
<h1>
49-
<ais-highlight :result="result" attribute-name="{{attributesToDisplay.[0]}}"></ais-highlight>
49+
<ais-highlight
50+
:result="result"
51+
attribute-name="{{attributesToDisplay.[0]}}"
52+
/>
5053
</h1>
5154
{{#each attributesToDisplay}}
5255
{{#unless @first}}
5356
<p>
54-
<ais-highlight :result="result" attribute-name="{{this}}"></ais-highlight>
57+
<ais-highlight
58+
:result="result"
59+
attribute-name="{{this}}"
60+
/>
5561
</p>
5662
{{/unless}}
5763
{{/each}}
5864
</article>
5965
</template>
6066
</ais-results>
6167
{{else}}
62-
<ais-results class="ais-Hits-list"></ais-results>
68+
<ais-results class="ais-Hits-list" />
6369
{{/if}}
6470

6571
<div class="pagination">
@@ -74,7 +80,7 @@
7480
'ais-pagination__item--last': 'ais-Pagination-item--last',
7581
'ais-pagination__link': 'ais-Pagination-link',
7682
}"
77-
></ais-pagination>
83+
/>
7884
</div>
7985
</div>
8086
</div>

src/templates/Vue InstantSearch/src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import InstantSearch from 'vue-instantsearch';
44

55
Vue.use(InstantSearch);
66

7+
// eslint-disable-next-line no-new
78
new Vue({
89
el: '#app',
910
render: h => h(App),

0 commit comments

Comments
 (0)