File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,18 @@ export const linter = new class extends Linter {
18
18
}
19
19
20
20
/** @inheritdoc */
21
- verify ( textOrSourceCode , config ) {
22
- return super . verify ( textOrSourceCode , config , verifyOptions )
21
+ verify ( textOrSourceCode , config , options ) {
22
+ return super . verify ( textOrSourceCode , config , {
23
+ ...options ,
24
+ ...verifyOptions ,
25
+ } )
23
26
}
24
27
25
28
/** @inheritdoc */
26
- verifyAndFix ( text , config ) {
27
- return super . verifyAndFix ( text , config , verifyOptions )
29
+ verifyAndFix ( text , config , options ) {
30
+ return super . verifyAndFix ( text , config , {
31
+ ...options ,
32
+ ...verifyOptions ,
33
+ } )
28
34
}
29
35
} ( )
Original file line number Diff line number Diff line change 4
4
class =" playground__editor"
5
5
:code =" code"
6
6
:config =" actualConfig"
7
+ :filename =" filename"
7
8
:format =" formatOptions"
8
9
:language =" language"
9
10
:linter =" linter"
@@ -76,6 +77,10 @@ export default {
76
77
return config
77
78
},
78
79
80
+ filename () {
81
+ return this .looksHtml ? " vue-eslint-demo.vue" : " vue-eslint-demo.js"
82
+ },
83
+
79
84
formatOptions () {
80
85
return {
81
86
insertSpaces: this .indentType === " space" ,
@@ -84,13 +89,16 @@ export default {
84
89
},
85
90
86
91
language () {
87
- const trimedCode = this .code .trim ()
88
- return trimedCode .startsWith (" <" ) ? " html" : " javascript"
92
+ return this .looksHtml ? " html" : " javascript"
89
93
},
90
94
91
95
linter () {
92
96
return linter
93
97
},
98
+
99
+ looksHtml () {
100
+ return this .code .trim ().startsWith (" <" )
101
+ },
94
102
},
95
103
96
104
methods: {
You can’t perform that action at this time.
0 commit comments