Skip to content

Commit b2e7226

Browse files
committed
Eslint --fix.
1 parent 1c26543 commit b2e7226

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2657
-2648
lines changed

.babelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"presets": [
3-
["@babel/preset-env"]
4-
]
2+
"presets": [
3+
["@babel/preset-env"]
4+
]
55
}

.eslintrc.json

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
{
2-
"extends": [
3-
"standard",
4-
"plugin:vue/recommended"
5-
],
6-
"env": {
7-
"browser": true,
8-
"amd": true
9-
},
10-
"globals": {
11-
"it": "readonly",
12-
"expect": "readonly",
13-
"describe": "readonly"
14-
},
15-
"parserOptions": {
16-
"ecmaVersion": 5,
17-
"sourceType": "module"
18-
},
19-
"rules": {
20-
"indent": ["error", 4],
21-
"arrow-parens": 0,
22-
"generator-star-spacing": 0,
23-
"no-trailing-spaces": [ 0, { "skipBlankLines": true } ],
24-
"vue/html-indent": ["error", 4, {
25-
"baseIndent": 0,
26-
"alignAttributesVertically": false
27-
}],
28-
"vue/script-indent": ["error", 4],
29-
"vue/max-attributes-per-line": ["error", {
30-
"singleline": 10,
31-
"multiline": {
32-
"max": 10,
33-
"allowFirstLine": true
34-
}
35-
}]
36-
}
37-
}
2+
"extends": [
3+
"standard",
4+
"plugin:vue/recommended"
5+
],
6+
"env": {
7+
"browser": true,
8+
"amd": true
9+
},
10+
"globals": {
11+
"it": "readonly",
12+
"expect": "readonly",
13+
"describe": "readonly"
14+
},
15+
"parserOptions": {
16+
"ecmaVersion": 5,
17+
"sourceType": "module"
18+
},
19+
"rules": {
20+
"arrow-parens": 0,
21+
"generator-star-spacing": 0,
22+
"no-trailing-spaces": [ 0, { "skipBlankLines": true } ],
23+
"vue/html-indent": ["error", 2, {
24+
"baseIndent": 0,
25+
"alignAttributesVertically": false
26+
}],
27+
"vue/script-indent": ["error", 2],
28+
"vue/max-attributes-per-line": ["error", {
29+
"singleline": 10,
30+
"multiline": {
31+
"max": 10,
32+
"allowFirstLine": true
33+
}
34+
}]
35+
}
36+
}

README.md

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<p>
2-
<a href="https://travis-ci.org/tangbc/vue-virtual-scroll-list">
3-
<img alt="Travis CI Status" src="https://travis-ci.org/tangbc/vue-virtual-scroll-list.svg?branch=master"/>
4-
</a>
5-
<a href="https://codecov.io/gh/tangbc/vue-virtual-scroll-list">
6-
<img alt="Code Coverage" src="https://codecov.io/gh/tangbc/vue-virtual-scroll-list/branch/master/graph/badge.svg"/>
7-
</a>
8-
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
9-
<img alt="NPM downloads" src="https://img.shields.io/npm/dm/vue-virtual-scroll-list.svg">
10-
</a>
11-
<a href="http://packagequality.com/#?package=vue-virtual-scroll-list">
12-
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
13-
</a>
14-
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
15-
<img alt="NPM version" src="https://img.shields.io/npm/v/vue-virtual-scroll-list.svg"/>
16-
</a>
17-
<a href="https://vuejs.org/">
18-
<img alt="Vue version" src="https://img.shields.io/badge/vue-%3E=2.3.0-brightgreen.svg"/>
19-
</a>
20-
<a href="https://opensource.org/licenses/MIT">
21-
<img alt="License" src="https://img.shields.io/npm/l/vue-virtual-scroll-list.svg">
22-
</a>
2+
<a href="https://travis-ci.org/tangbc/vue-virtual-scroll-list">
3+
<img alt="Travis CI Status" src="https://travis-ci.org/tangbc/vue-virtual-scroll-list.svg?branch=master"/>
4+
</a>
5+
<a href="https://codecov.io/gh/tangbc/vue-virtual-scroll-list">
6+
<img alt="Code Coverage" src="https://codecov.io/gh/tangbc/vue-virtual-scroll-list/branch/master/graph/badge.svg"/>
7+
</a>
8+
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
9+
<img alt="NPM downloads" src="https://img.shields.io/npm/dm/vue-virtual-scroll-list.svg">
10+
</a>
11+
<a href="http://packagequality.com/#?package=vue-virtual-scroll-list">
12+
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
13+
</a>
14+
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
15+
<img alt="NPM version" src="https://img.shields.io/npm/v/vue-virtual-scroll-list.svg"/>
16+
</a>
17+
<a href="https://vuejs.org/">
18+
<img alt="Vue version" src="https://img.shields.io/badge/vue-%3E=2.3.0-brightgreen.svg"/>
19+
</a>
20+
<a href="https://opensource.org/licenses/MIT">
21+
<img alt="License" src="https://img.shields.io/npm/l/vue-virtual-scroll-list.svg">
22+
</a>
2323
</p>
2424

2525
## Table of contents
@@ -28,12 +28,12 @@
2828
* [Live demos](#live-demos)
2929
* [How it works](#how-it-works)
3030
* [Simple usage](#simple-usage)
31-
* [vfor-mode](#vfor-mode)
32-
* [item-mode](#item-mode)
33-
* [variable height](#variable-height)
31+
* [vfor-mode](#vfor-mode)
32+
* [item-mode](#item-mode)
33+
* [variable height](#variable-height)
3434
* [Performance comparison](#performance-comparison)
35-
* [Build time wasted](#build-time-wasted)
36-
* [Total memory used](#total-memory-used)
35+
* [Build time wasted](#build-time-wasted)
36+
* [Total memory used](#total-memory-used)
3737
* [Attentions](#attentions)
3838
* [**Props type**](#props-type)
3939
* [Public methods](#public-methods)
@@ -80,23 +80,23 @@ All you need to care about is only data!
8080

8181
```vue
8282
<template>
83-
<div>
84-
<virtual-list :size="40" :remain="8">
85-
<item v-for="item of items" :key="item.id" />
86-
</virtual-list>
87-
</div>
83+
<div>
84+
<virtual-list :size="40" :remain="8">
85+
<item v-for="item of items" :key="item.id" />
86+
</virtual-list>
87+
</div>
8888
</template>
8989
<script>
90-
import item from '../item.vue'
91-
import virtualList from 'vue-virtual-scroll-list'
92-
export default {
93-
data () {
94-
return {
95-
items: [ {id: 1}, {id: 2}, {id: 3}, ... ]
96-
}
97-
},
98-
components: { item, 'virtual-list': virtualList }
99-
}
90+
import item from '../item.vue'
91+
import virtualList from 'vue-virtual-scroll-list'
92+
export default {
93+
data () {
94+
return {
95+
items: [ {id: 1}, {id: 2}, {id: 3}, ... ]
96+
}
97+
},
98+
components: { item, 'virtual-list': virtualList }
99+
}
100100
</script>
101101
```
102102

@@ -106,36 +106,36 @@ This mode can save a considerable amount of memory and performance. Props `item`
106106

107107
```vue
108108
<template>
109-
<div>
110-
<virtual-list :size="40" :remain="8"
111-
:item="item"
112-
:itemcount="100000"
113-
:itemprops="getItemprops"
114-
/>
115-
</div>
109+
<div>
110+
<virtual-list :size="40" :remain="8"
111+
:item="item"
112+
:itemcount="100000"
113+
:itemprops="getItemprops"
114+
/>
115+
</div>
116116
</template>
117117
<script>
118-
import itemComponent from '../item.vue'
119-
import virtualList from 'vue-virtual-scroll-list'
120-
export default {
121-
data () {
122-
return {
123-
item: itemComponent,
124-
}
125-
},
126-
methods: {
127-
getItemprops (itemIndex) {
128-
// <item/> will render with following data object:
129-
// https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
130-
return {
131-
props: itemProps,
132-
attrs: itemAttrs,
133-
...
134-
}
135-
}
136-
},
137-
components: { 'virtual-list': virtualList }
138-
}
118+
import itemComponent from '../item.vue'
119+
import virtualList from 'vue-virtual-scroll-list'
120+
export default {
121+
data () {
122+
return {
123+
item: itemComponent,
124+
}
125+
},
126+
methods: {
127+
getItemprops (itemIndex) {
128+
// <item/> will render with following data object:
129+
// https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
130+
return {
131+
props: itemProps,
132+
attrs: itemAttrs,
133+
...
134+
}
135+
}
136+
},
137+
components: { 'virtual-list': virtualList }
138+
}
139139
</script>
140140
141141
```
@@ -149,11 +149,11 @@ Using variable height, props `remain` and `size` is still required. All the inde
149149
If you assign `variable` as `true`, **do not** set inline style height inside `<item/>` component, you **must** set inline style height on `<item/>` component outside directly, such as:
150150
```vue
151151
<template>
152-
<div>
153-
<virtual-list :size="40" :remain="8" :variable="true">
154-
<item v-for="item of items" :key="item.id" :style="{ height: item.height + 'px' }" />
155-
</virtual-list>
156-
</div>
152+
<div>
153+
<virtual-list :size="40" :remain="8" :variable="true">
154+
<item v-for="item of items" :key="item.id" :style="{ height: item.height + 'px' }" />
155+
</virtual-list>
156+
</div>
157157
</template>
158158
```
159159

demos/common/Corner.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<template>
22
<a :href="url" class="github-corner" aria-label="View source on GitHub">
3-
<svg :width="size" :height="size" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0; z-index: 1000;" aria-hidden="true">
4-
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
5-
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" style="transform-origin: 130px 106px;" fill="currentColor" class="octo-arm" />
6-
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body" />
7-
</svg>
3+
<svg :width="size" :height="size" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0; z-index: 1000;" aria-hidden="true">
4+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
5+
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" style="transform-origin: 130px 106px;" fill="currentColor" class="octo-arm" />
6+
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body" />
7+
</svg>
88
</a>
99
</template>
1010

1111
<script>
1212
import { isMobile } from './util'
1313
1414
export default {
15-
name: 'GithubCorner',
15+
name: 'GithubCorner',
1616
17-
props: {
18-
path: {
19-
type: String,
20-
default: ''
21-
}
22-
},
17+
props: {
18+
path: {
19+
type: String,
20+
default: ''
21+
}
22+
},
2323
24-
data () {
25-
return {
26-
size: isMobile ? 40 : 80
27-
}
28-
},
24+
data () {
25+
return {
26+
size: isMobile ? 40 : 80
27+
}
28+
},
2929
30-
computed: {
31-
url () {
32-
return `https://github.com/tangbc/vue-virtual-scroll-list/tree/master/demos` + (this.path || '')
33-
}
30+
computed: {
31+
url () {
32+
return `https://github.com/tangbc/vue-virtual-scroll-list/tree/master/demos` + (this.path || '')
3433
}
34+
}
3535
}
3636
</script>
3737

0 commit comments

Comments
 (0)