Skip to content

Commit 945da76

Browse files
committed
ESLint: code cleanup 2
1 parent 26816b2 commit 945da76

File tree

10 files changed

+13
-23
lines changed

10 files changed

+13
-23
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module.exports = {
1919
"vue"
2020
],
2121
"rules": {
22+
"vue/html-indent": "off"
2223
}
2324
};

src/App.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
<script>
1010
import TradingVue from './TradingVue.vue'
1111
import Data from '../data/data.json'
12-
import Utils from './stuff/utils.js'
1312
1413
export default {
1514
name: 'app',
1615
components: {
1716
TradingVue
1817
},
1918
methods: {
20-
onResize(event) {
19+
onResize() {
2120
this.width = window.innerWidth
2221
this.height = window.innerHeight
2322
}

src/components/Chart.vue

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ import Context from '../stuff/context.js'
2222
import Layout from './js/layout.js'
2323
import Utils from '../stuff/utils.js'
2424
import CursorUpdater from './js/updater.js'
25-
import Grid from './Grid.vue'
2625
import GridSection from './Section.vue'
2726
import Botbar from './Botbar.vue'
28-
import Sidebar from './Sidebar.vue'
2927
3028
export default {
3129
name: 'Chart',
@@ -34,10 +32,8 @@ export default {
3432
'overlays', 'tv_id', 'config', 'buttons'
3533
],
3634
components: {
37-
Grid,
3835
GridSection,
39-
Botbar,
40-
Sidebar,
36+
Botbar
4137
},
4238
created() {
4339
@@ -87,7 +83,7 @@ export default {
8783
if (this.ohlcv.length < dl) {
8884
var s = 0, d = ml
8985
} else {
90-
var s = l - dl, d = 0.5
86+
s = l - dl, d = 0.5
9187
}
9288
9389
Utils.overwrite(this.range, [

src/components/Legend.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
C<span class="t-vue-lspan" >{{ohlcv[3]}}</span>
1515
V<span class="t-vue-lspan" >{{ohlcv[4]}}</span>
1616
</div>
17-
<div class="t-vue-ind" v-for="ind of this.indicators">
17+
<div class="t-vue-ind" v-for="ind in this.indicators">
1818
<span class="t-vue-iname">{{ind.name}}</span>
1919
<button-group
2020
v-bind:buttons="common.buttons"
@@ -27,7 +27,7 @@
2727
</button-group>
2828
<span class="t-vue-ivalues" v-if="ind.v">
2929
<span class="t-vue-lspan t-vue-ivalue"
30-
v-for="v of ind.values" :style="{ color: v.color }">
30+
v-for="v in ind.values" :style="{ color: v.color }">
3131
{{v.value}}
3232
</span>
3333
</span>

src/components/LegendButton.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<img class="t-vue-lbtn" :src="base64"
33
:id="uuid"
4-
@click="onclick"
5-
></img>
4+
@click="onclick">
65
</template>
76
<script>
87
@@ -21,7 +20,7 @@ export default {
2120
file_name() {
2221
let id = this.$props.id
2322
if (this.$props.id === 'display') {
24-
id = this.$props.display ? 'display_on' : 'display_off'
23+
id = this.$props.display ? 'display_on' : 'display_off'
2524
}
2625
return id + '.png'
2726
},

src/components/Section.vue

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export default {
101101
return p
102102
},
103103
get_meta_props() {
104-
const id = this.$props.grid_id
105104
return this.meta_props
106105
}
107106
},

src/components/js/layout.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// data formatting (e.g. grid width depends on sidebar precision)
66
// So it's better to calc all in one place.
77

8-
import Const from '../../stuff/constants.js'
98
import GridMaker from './grid_maker.js'
109

1110
function Layout(params) {

src/components/overlays/Trades.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ export default {
4545
var pos = 'Short'
4646
break
4747
case 0:
48-
var pos = 'Closed'
48+
pos = 'Closed'
4949
break
5050
case 1:
51-
var pos = 'Long'
51+
pos = 'Long'
5252
break
5353
default:
54-
var pos = 'Unknown'
54+
pos = 'Unknown'
5555
}
5656
5757
return [

src/examples/Reactive.vue

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@
99
1010
import TradingVue from './TradingVue.vue'
1111
import Data from '../data/data.json'
12-
import Utils from './stuff/utils.js'
13-
14-
import Grin from './examples/overlays/Grin.vue'
1512
1613
export default {
1714
name: 'app',
1815
components: {
1916
TradingVue
2017
},
2118
methods: {
22-
onResize(event) {
19+
onResize() {
2320
this.width = window.innerWidth
2421
this.height = window.innerHeight
2522
}

src/stuff/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
var IndexedArray = require("arrayslicer");
2+
import IndexedArray from 'arrayslicer'
33

44
export default {
55

0 commit comments

Comments
 (0)