File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,25 @@ export class TypeCoverage implements BaseLinter {
1919 const results = Object . entries ( groups ) . map ( ( [ file , anys ] ) => {
2020 return {
2121 filePath : file ,
22- messages : anys . map ( any => ( {
23- ruleId : getRuleId ( any ) ,
24- message : getMessages ( any ) ,
25- severity : 1 ,
26- line : any . line + 1 ,
27- column : any . character + 1 ,
28- endColumn : any . character + 1 + any . text . length
29- } ) )
22+ messages : anys . map ( any => {
23+ const line = any . line + 1
24+ const column = any . character + 1
25+ const lines = any . text . split ( '\n' )
26+ const [ firstLine , ...rest ] = lines
27+ const lastLine = [ ...rest ] . pop ( ) ?? firstLine
28+
29+ return {
30+ ruleId : getRuleId ( any ) ,
31+ message : getMessages ( any ) ,
32+ severity : 1 ,
33+ line,
34+ endLine : line + lines . length - 1 ,
35+ column,
36+ endColumn : lines . length === 1
37+ ? column + lastLine . length
38+ : lastLine . length
39+ }
40+ } )
3041 } satisfies LintResult
3142 } )
3243 const rules = Object . entries ( groups )
You can’t perform that action at this time.
0 commit comments