File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,14 +353,12 @@ export class LintFile {
353353
354354 type ||= customMime . findByFilename ( this . #fullPath ) ?. essence ;
355355
356- type ||= (
357- await customMime . findByShebang ( {
358- "path" : this . #fullPath,
359- "content" : await this . #file. slice ( 0 , 50 ) . text ( "latin1" ) ,
360- } )
361- ) ?. essence ;
362-
363- type ||= this . #file. type ;
356+ if ( ! type ) {
357+ type =
358+ customMime . findByShebangSync ( {
359+ "content" : ( await this . #file. slice ( 0 , 50 ) . buffer ( ) ) . toString ( "latin1" ) ,
360+ } ) ?. essence || this . #file. type ;
361+ }
364362
365363 this . #type = TYPES [ type ] ;
366364 }
@@ -373,7 +371,7 @@ export class LintFile {
373371 }
374372
375373 // read file content
376- this . #originalData = this . #data = await this . #file. text ( "utf8" ) ;
374+ this . #originalData = this . #data = await this . #file. text ( ) ;
377375
378376 // add default extension
379377 if ( this . #type ) {
You can’t perform that action at this time.
0 commit comments