Skip to content

Commit 7993c8f

Browse files
author
Pooya Parsa
committed
chore(docs): apply eslint fixes on .vue files
1 parent a02f10d commit 7993c8f

File tree

19 files changed

+1020
-772
lines changed

19 files changed

+1020
-772
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ module.exports = {
2020
Tether: true,
2121
Promise: true,
2222
Vue: true
23-
}
23+
},
24+
rules: {
25+
"vue/attributes-order": 0
26+
}
2427
}

docs/components/codemirror.vue

Lines changed: 85 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,94 @@
11
<template>
2-
<textarea ref="textArea" :value="value"></textarea>
2+
<textarea
3+
ref="textArea"
4+
:value="value"/>
35
</template>
46

57
<script>
6-
let CodeMirror;
8+
let CodeMirror
79
8-
if (typeof window !== 'undefined') {
9-
CodeMirror = require('codemirror');
10+
if (typeof window !== 'undefined') {
11+
CodeMirror = require('codemirror')
1012
11-
/* eslint-disable import/no-unassigned-import */
12-
require('codemirror/mode/javascript/javascript');
13-
/* eslint-disable import/no-unassigned-import */
14-
require('codemirror/mode/shell/shell');
15-
/* eslint-disable import/no-unassigned-import */
16-
require('codemirror/mode/vue/vue');
17-
/* eslint-disable import/no-unassigned-import */
18-
require('codemirror/mode/htmlmixed/htmlmixed');
19-
/* eslint-disable import/no-unassigned-import */
20-
require('codemirror/addon/edit/closetag');
21-
/* eslint-disable import/no-unassigned-import */
22-
require('codemirror/addon/edit/closebrackets');
23-
/* eslint-disable import/no-unassigned-import */
24-
require('codemirror/addon/fold/xml-fold');
25-
}
13+
/* eslint-disable import/no-unassigned-import */
14+
require('codemirror/mode/javascript/javascript')
15+
/* eslint-disable import/no-unassigned-import */
16+
require('codemirror/mode/shell/shell')
17+
/* eslint-disable import/no-unassigned-import */
18+
require('codemirror/mode/vue/vue')
19+
/* eslint-disable import/no-unassigned-import */
20+
require('codemirror/mode/htmlmixed/htmlmixed')
21+
/* eslint-disable import/no-unassigned-import */
22+
require('codemirror/addon/edit/closetag')
23+
/* eslint-disable import/no-unassigned-import */
24+
require('codemirror/addon/edit/closebrackets')
25+
/* eslint-disable import/no-unassigned-import */
26+
require('codemirror/addon/fold/xml-fold')
27+
}
2628
27-
export default {
28-
data() {
29-
return {
30-
CM: null
31-
};
32-
},
33-
mounted() {
34-
this.CM = CodeMirror.fromTextArea(this.$refs.textArea, {
35-
mode: this.mode,
36-
theme: this.theme,
37-
tabMode: this.tabMode,
38-
lineWrapping: this.lineWrapping,
39-
lineNumbers: this.lineNumbers,
40-
autoCloseTags: true,
41-
autoCloseBrackets: true,
42-
readOnly: this.readOnly
43-
});
29+
export default {
30+
props: {
31+
value: {
32+
type: String,
33+
default: ''
34+
},
35+
mode: {
36+
type: [String, Object],
37+
default: ''
38+
},
39+
theme: {
40+
type: String,
41+
default: 'default'
42+
},
43+
tabMode: {
44+
type: String,
45+
default: 'indent'
46+
},
47+
lineWrapping: {
48+
type: Boolean,
49+
default: true
50+
},
51+
lineNumbers: {
52+
type: Boolean,
53+
default: true
54+
},
55+
readOnly: {
56+
type: Boolean,
57+
default: false
58+
}
59+
},
60+
data () {
61+
return {
62+
CM: null
63+
}
64+
},
65+
watch: {
66+
value (new_val, old_val) {
67+
if (!old_val || old_val === '') {
68+
this.CM.setValue(new_val)
69+
}
70+
}
71+
},
72+
mounted () {
73+
this.CM = CodeMirror.fromTextArea(this.$refs.textArea, {
74+
mode: this.mode,
75+
theme: this.theme,
76+
tabMode: this.tabMode,
77+
lineWrapping: this.lineWrapping,
78+
lineNumbers: this.lineNumbers,
79+
autoCloseTags: true,
80+
autoCloseBrackets: true,
81+
readOnly: this.readOnly
82+
})
4483
45-
this.CM.on('change', () => {
46-
this.$emit('input', this.CM.getValue());
47-
});
48-
},
49-
watch: {
50-
value(new_val, old_val) {
51-
if (!old_val || old_val === '') {
52-
this.CM.setValue(new_val);
53-
}
54-
}
55-
},
56-
beforeDestroy() {
57-
if (this.CM) {
58-
this.CM.toTextArea();
59-
}
60-
},
61-
props: {
62-
value: {
63-
type: String,
64-
default: ''
65-
},
66-
mode: {
67-
type: [String, Object],
68-
default: ''
69-
},
70-
theme: {
71-
type: String,
72-
default: 'default'
73-
},
74-
tabMode: {
75-
type: String,
76-
default: 'indent'
77-
},
78-
lineWrapping: {
79-
type: Boolean,
80-
default: true
81-
},
82-
lineNumbers: {
83-
type: Boolean,
84-
default: true
85-
},
86-
readOnly: {
87-
type: Boolean,
88-
default: false
89-
}
90-
}
91-
};
84+
this.CM.on('change', () => {
85+
this.$emit('input', this.CM.getValue())
86+
})
87+
},
88+
beforeDestroy () {
89+
if (this.CM) {
90+
this.CM.toTextArea()
91+
}
92+
}
93+
}
9294
</script>

0 commit comments

Comments
 (0)