@@ -29,7 +29,7 @@ module.exports = function lint (args = {}, api, silent) {
2929 if ( isVueFile ( file ) ) {
3030 const parts = vueFileCache . get ( path . normalize ( file ) )
3131 if ( parts ) {
32- parts . content = content ;
32+ parts . content = content
3333 const { before, after } = parts
3434 content = `${ before } \n${ content . trim ( ) } \n${ after } `
3535 }
@@ -43,19 +43,18 @@ module.exports = function lint (args = {}, api, silent) {
4343 }
4444
4545 const parseTSFromVueFile = file => {
46-
4746 // If the file has already been cached, don't read the file again. Use the cache instead.
4847 if ( vueFileCache . has ( file ) ) {
49- return vueFileCache . get ( file ) . content ;
48+ return vueFileCache . get ( file )
5049 }
51-
50+
5251 const content = fs . readFileSync ( file , 'utf-8' )
5352 const { script } = vueCompiler . parseComponent ( content , { pad : 'line' } )
5453 if ( script && / ^ t s x ? $ / . test ( script . lang ) ) {
5554 vueFileCache . set ( file , {
5655 before : content . slice ( 0 , script . start ) ,
5756 after : content . slice ( script . end ) ,
58- content : script . content ,
57+ content : script . content
5958 } )
6059 return script
6160 }
@@ -70,7 +69,7 @@ module.exports = function lint (args = {}, api, silent) {
7069 program . getSourceFile = function ( file , languageVersion , onError ) {
7170 if ( isVueFile ( file ) ) {
7271 const { content, lang = 'js' } = parseTSFromVueFile ( file ) || { content : '' , lang : 'js' }
73- const contentLang = ts . ScriptKind [ lang . toUpperCase ( ) ] ;
72+ const contentLang = ts . ScriptKind [ lang . toUpperCase ( ) ]
7473 return ts . createSourceFile ( file , content , languageVersion , true , contentLang )
7574 } else {
7675 return getSourceFile . call ( this , file , languageVersion , onError )
0 commit comments