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 {
1818 }
1919
2020 /** @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+ } )
2326 }
2427
2528 /** @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+ } )
2834 }
2935} ( )
Original file line number Diff line number Diff line change 44 class =" playground__editor"
55 :code =" code"
66 :config =" actualConfig"
7+ :filename =" filename"
78 :format =" formatOptions"
89 :language =" language"
910 :linter =" linter"
@@ -76,6 +77,10 @@ export default {
7677 return config
7778 },
7879
80+ filename () {
81+ return this .looksHtml ? " vue-eslint-demo.vue" : " vue-eslint-demo.js"
82+ },
83+
7984 formatOptions () {
8085 return {
8186 insertSpaces: this .indentType === " space" ,
@@ -84,13 +89,16 @@ export default {
8489 },
8590
8691 language () {
87- const trimedCode = this .code .trim ()
88- return trimedCode .startsWith (" <" ) ? " html" : " javascript"
92+ return this .looksHtml ? " html" : " javascript"
8993 },
9094
9195 linter () {
9296 return linter
9397 },
98+
99+ looksHtml () {
100+ return this .code .trim ().startsWith (" <" )
101+ },
94102 },
95103
96104 methods: {
You can’t perform that action at this time.
0 commit comments