Repository: microsoft/typescript-go
Pull request #510: Process directive in multi-line comments
Author: login: haoqixu
Created: 2025-03-12T07:34:33Z | Merged: 2025-03-12T18:37:54Z

Fixes #495

Linked issue #495: block-style directive comments don't work
This errors with `Type 'number' is not assignable to type 'string'`

```ts
/* @ts-ignore */
const s: string = 5
```

Diff:
diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go
index c3eae52e1cf..3352825f168 100644
--- a/internal/scanner/scanner.go
+++ b/internal/scanner/scanner.go
@@ -570,11 +570,12 @@ func (s *Scanner) Scan() ast.Kind {
 						s.pos += size
 					}
 				}
-				s.processCommentDirective(s.tokenStart, s.pos)
+				s.processCommentDirective(s.tokenStart, s.pos, false)
 				continue
 			}
 			if s.charAt(1) == '*' {
 				s.pos += 2
+				lastline := s.tokenStart
 				isJSDoc := s.char() == '*' && s.charAt(1) != '/'
 				for {
 					ch = s.char()
@@ -587,21 +588,25 @@ func (s *Scanner) Scan() ast.Kind {
 							s.pos += 2
 							break
 						}
+						s.pos++
 						if ch == '\r' || ch == '\n' {
+							lastline = s.pos
 							s.tokenFlags |= ast.TokenFlagsPrecedingLineBreak
 						}
-						s.pos++
 					} else {
 						commentCh, size := s.charAndSize()
+						s.pos += size
 						if stringutil.IsLineBreak(commentCh) {
+							lastline = s.pos
 							s.tokenFlags |= ast.TokenFlagsPrecedingLineBreak
 						}
-						s.pos += size
 					}
 				}
 				if isJSDoc && s.shouldParseJSDoc() {
 					s.tokenFlags |= ast.TokenFlagsPrecedingJSDocComment
 				}
+
+				s.processCommentDirective(lastline, s.pos, true)
 				continue
 			}
 			if s.charAt(1) == '=' {
@@ -858,9 +863,17 @@ func (s *Scanner) Scan() ast.Kind {
 	}
 }
 
-func (s *Scanner) processCommentDirective(start int, end int) {
+func (s *Scanner) processCommentDirective(start int, end int, multiline bool) {
 	// Skip starting slashes and whitespace
-	pos := start + 2
+	pos := start
+	if multiline {
+		for pos < len(s.text) && (s.text[pos] == '*' || s.text[pos] == '/') {
+			pos++
+		}
+	} else {
+		// Skip "//" for single line comments
+		pos += 2
+	}
 	for pos < len(s.text) && (s.text[pos] == ' ' || s.text[pos] == '\t') {
 		pos++
 	}
diff --git a/testdata/baselines/reference/submodule/conformance/multiline.errors.txt b/testdata/baselines/reference/submodule/conformance/multiline.errors.txt
index f9519a413a4..ecd31ae4576 100644
--- a/testdata/baselines/reference/submodule/conformance/multiline.errors.txt
+++ b/testdata/baselines/reference/submodule/conformance/multiline.errors.txt
@@ -1,28 +1,28 @@
-a.ts(5,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-a.ts(9,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
+a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
 b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type declarations.
+b.tsx(17,1): error TS2578: Unused '@ts-expect-error' directive.
+b.tsx(28,6): error TS2578: Unused '@ts-expect-error' directive.
+b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
 
 
-==== a.ts (2 errors) ====
+==== a.ts (1 errors) ====
     export const texts: string[] = [];
     
     /**
      @ts-ignore */
     texts.push(100);
-               ~~~
-!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
     
     /**
      @ts-expect-error */
     texts.push(100);
-               ~~~
-!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
     
     /**
      @ts-expect-error */
+    ~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
     texts.push("100");
     
-==== b.tsx (1 errors) ====
+==== b.tsx (4 errors) ====
     import * as React from "react";
                            ~~~~~~~
 !!! error TS2307: Cannot find module 'react' or its corresponding type declarations.
@@ -42,6 +42,8 @@ b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type
     
         {/*
        @ts-expect-error */}
+    ~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
         <MyComponent foo={100} />
     
         {/*
@@ -53,10 +55,14 @@ b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type
         <MyComponent foo={100} />
     
         {/*@ts-expect-error*/}
+         ~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
         <MyComponent foo={100} />
     
         {/*
        @ts-expect-error */}
+    ~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
         <MyComponent foo={"hooray"} />
       </div>
     );
diff --git a/testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
index 54323caecc8..db6c8438ceb 100644
--- a/testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
+++ b/testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
@@ -1,48 +1,40 @@
 --- old.multiline.errors.txt
 +++ new.multiline.errors.txt
 @@= skipped -0, +0 lines =@@
--a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
--b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
-+a.ts(5,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-+a.ts(9,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
+ a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
 +b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type declarations.
++b.tsx(17,1): error TS2578: Unused '@ts-expect-error' directive.
++b.tsx(28,6): error TS2578: Unused '@ts-expect-error' directive.
+ b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
  
  
--==== a.ts (1 errors) ====
-+==== a.ts (2 errors) ====
-     export const texts: string[] = [];
-     
-     /**
-      @ts-ignore */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
+@@= skipped -18, +21 lines =@@
+ !!! error TS2578: Unused '@ts-expect-error' directive.
      texts.push("100");
      
- ==== b.tsx (1 errors) ====
+-==== b.tsx (1 errors) ====
++==== b.tsx (4 errors) ====
      import * as React from "react";
 +                           ~~~~~~~
 +!!! error TS2307: Cannot find module 'react' or its corresponding type declarations.
      
      export function MyComponent(props: { foo: string }) {
        return <div />;
-@@= skipped -51, +56 lines =@@
+@@= skipped -18, +20 lines =@@
      
          {/*
         @ts-expect-error */}
--    ~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-         <MyComponent foo={"hooray"} />
-       </div>
-     );
++    ~~~~~~~~~~~~~~~~~~~~~~
++!!! error TS2578: Unused '@ts-expect-error' directive.
+         <MyComponent foo={100} />
+     
+         {/*
+@@= skipped -11, +13 lines =@@
+         <MyComponent foo={100} />
+     
+         {/*@ts-expect-error*/}
++         ~~~~~~~~~~~~~~~~~~~~
++!!! error TS2578: Unused '@ts-expect-error' directive.
+         <MyComponent foo={100} />
+     
+         {/*
diff --git a/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt b/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt
index 616f55d45b5..66ea5b9135c 100644
--- a/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt
+++ b/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt
@@ -1,12 +1,12 @@
-ts-expect-error.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
 ts-expect-error.ts(8,1): error TS2578: Unused '@ts-expect-error' directive.
-ts-expect-error.ts(19,5): error TS2322: Type 'string' is not assignable to type 'number'.
+ts-expect-error.ts(11,1): error TS2578: Unused '@ts-expect-error' directive.
 ts-expect-error.ts(21,1): error TS2578: Unused '@ts-expect-error' directive.
+ts-expect-error.ts(24,1): error TS2578: Unused '@ts-expect-error' directive.
+ts-expect-error.ts(28,1): error TS2578: Unused '@ts-expect-error' directive.
 ts-expect-error.ts(31,5): error TS2322: Type 'string' is not assignable to type 'number'.
 ts-expect-error.ts(37,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
 ts-expect-error.ts(39,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
 ts-expect-error.ts(40,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
-ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type 'number'.
 
 
 ==== ts-expect-error.ts (9 errors) ====
@@ -16,8 +16,6 @@ ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type
     /*
      @ts-expect-error additional commenting */
     var invalidCommentedFancyMulti: number = 'nope';
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS2322: Type 'string' is not assignable to type 'number'.
     
     // @ts-expect-error additional commenting
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -25,6 +23,8 @@ ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type
     var validCommentedFancySingle: string = 'nope';
     
     /* @ts-expect-error additional commenting */
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
     var validCommentedFancyMulti: string = 'nope';
     
     // @ts-expect-error
@@ -33,8 +33,6 @@ ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type
     /*
      @ts-expect-error */
     var invalidCommentedPlainMulti: number = 'nope';
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS2322: Type 'string' is not assignable to type 'number'.
     
     // @ts-expect-error
     ~~~~~~~~~~~~~~~~~~~
@@ -42,10 +40,14 @@ ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type
     var validCommentedPlainSingle: string = 'nope';
     
     /* @ts-expect-error */
+    ~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
     var validCommentedPlainMulti1: string = 'nope';
     
     /*
     @ts-expect-error */
+    ~~~~~~~~~~~~~~~~~~~
+!!! error TS2578: Unused '@ts-expect-error' directive.
     var validCommentedPlainMulti2: string = 'nope';
     
     var invalidPlain: number = 'nope';
@@ -73,6 +75,4 @@ ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type
     /*
      @ts-expect-error: additional commenting with no whitespace */
     var invalidCommentedFancyMulti: number = 'nope';
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS2322: Type 'string' is not assignable to type 'number'.
     
\ No newline at end of file
diff --git a/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt.diff
deleted file mode 100644
index f7dc0bcfc8f..00000000000
--- a/testdata/baselines/reference/submodule/conformance/ts-expect-error.errors.txt.diff
+++ /dev/null
@@ -1,67 +0,0 @@
---- old.ts-expect-error.errors.txt
-+++ new.ts-expect-error.errors.txt
-@@= skipped -0, +0 lines =@@
-+ts-expect-error.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
- ts-expect-error.ts(8,1): error TS2578: Unused '@ts-expect-error' directive.
--ts-expect-error.ts(11,1): error TS2578: Unused '@ts-expect-error' directive.
-+ts-expect-error.ts(19,5): error TS2322: Type 'string' is not assignable to type 'number'.
- ts-expect-error.ts(21,1): error TS2578: Unused '@ts-expect-error' directive.
--ts-expect-error.ts(24,1): error TS2578: Unused '@ts-expect-error' directive.
--ts-expect-error.ts(28,1): error TS2578: Unused '@ts-expect-error' directive.
- ts-expect-error.ts(31,5): error TS2322: Type 'string' is not assignable to type 'number'.
- ts-expect-error.ts(37,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
- ts-expect-error.ts(39,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
- ts-expect-error.ts(40,2): error TS2367: This comparison appears to be unintentional because the types 'true' and 'false' have no overlap.
-+ts-expect-error.ts(47,5): error TS2322: Type 'string' is not assignable to type 'number'.
- 
- 
- ==== ts-expect-error.ts (9 errors) ====
-@@= skipped -15, +15 lines =@@
-     /*
-      @ts-expect-error additional commenting */
-     var invalidCommentedFancyMulti: number = 'nope';
-+        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-+!!! error TS2322: Type 'string' is not assignable to type 'number'.
-     
-     // @ts-expect-error additional commenting
-     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@@= skipped -7, +9 lines =@@
-     var validCommentedFancySingle: string = 'nope';
-     
-     /* @ts-expect-error additional commenting */
--    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-     var validCommentedFancyMulti: string = 'nope';
-     
-     // @ts-expect-error
-@@= skipped -10, +8 lines =@@
-     /*
-      @ts-expect-error */
-     var invalidCommentedPlainMulti: number = 'nope';
-+        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-+!!! error TS2322: Type 'string' is not assignable to type 'number'.
-     
-     // @ts-expect-error
-     ~~~~~~~~~~~~~~~~~~~
-@@= skipped -7, +9 lines =@@
-     var validCommentedPlainSingle: string = 'nope';
-     
-     /* @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-     var validCommentedPlainMulti1: string = 'nope';
-     
-     /*
-     @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-     var validCommentedPlainMulti2: string = 'nope';
-     
-     var invalidPlain: number = 'nope';
-@@= skipped -35, +31 lines =@@
-     /*
-      @ts-expect-error: additional commenting with no whitespace */
-     var invalidCommentedFancyMulti: number = 'nope';
-+        ~~~~~~~~~~~~~~~~~~~~~~~~~~
-+!!! error TS2322: Type 'string' is not assignable to type 'number'.
-     


Reviews:
user: login: jakebailey
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-12T10:20:53Z
user: login: haoqixu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T11:22:50Z
user: login: jakebailey
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-12T11:33:53Z
user: login: jakebailey
body: Thank you!
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-12T18:22:43Z

Review comments:
diff_hunk: @@ -1,48 +1,40 @@
 --- old.multiline.errors.txt
 +++ new.multiline.errors.txt
 @@= skipped -0, +0 lines =@@
--a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
--b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
-+a.ts(5,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-+a.ts(9,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
+ a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
 +b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type declarations.
++b.tsx(17,1): error TS2578: Unused '@ts-expect-error' directive.
++b.tsx(28,6): error TS2578: Unused '@ts-expect-error' directive.
+ b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
  
  
--==== a.ts (1 errors) ====
-+==== a.ts (2 errors) ====
-     export const texts: string[] = [];
-     
-     /**
-      @ts-ignore */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
+@@= skipped -18, +21 lines =@@
+ !!! error TS2578: Unused '@ts-expect-error' directive.
      texts.push("100");
      
- ==== b.tsx (1 errors) ====
+-==== b.tsx (1 errors) ====
++==== b.tsx (4 errors) ====
      import * as React from "react";
 +                           ~~~~~~~
 +!!! error TS2307: Cannot find module 'react' or its corresponding type declarations.
      
      export function MyComponent(props: { foo: string }) {
        return <div />;
-@@= skipped -51, +56 lines =@@
+@@= skipped -18, +20 lines =@@
      
          {/*
         @ts-expect-error */}
--    ~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-         <MyComponent foo={"hooray"} />
-       </div>
-     );
++    ~~~~~~~~~~~~~~~~~~~~~~
++!!! error TS2578: Unused '@ts-expect-error' directive.
path: testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
user: login: jakebailey
body: This diff indicates that this behavior doesn't match the old compiler, unfortunately.
created_at: 2025-03-12T10:20:53Z
author_association: MEMBER
diff_hunk: @@ -1,48 +1,40 @@
 --- old.multiline.errors.txt
 +++ new.multiline.errors.txt
 @@= skipped -0, +0 lines =@@
--a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
--b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
-+a.ts(5,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-+a.ts(9,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
+ a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
 +b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type declarations.
++b.tsx(17,1): error TS2578: Unused '@ts-expect-error' directive.
++b.tsx(28,6): error TS2578: Unused '@ts-expect-error' directive.
+ b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
  
  
--==== a.ts (1 errors) ====
-+==== a.ts (2 errors) ====
-     export const texts: string[] = [];
-     
-     /**
-      @ts-ignore */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
+@@= skipped -18, +21 lines =@@
+ !!! error TS2578: Unused '@ts-expect-error' directive.
      texts.push("100");
      
- ==== b.tsx (1 errors) ====
+-==== b.tsx (1 errors) ====
++==== b.tsx (4 errors) ====
      import * as React from "react";
 +                           ~~~~~~~
 +!!! error TS2307: Cannot find module 'react' or its corresponding type declarations.
      
      export function MyComponent(props: { foo: string }) {
        return <div />;
-@@= skipped -51, +56 lines =@@
+@@= skipped -18, +20 lines =@@
      
          {/*
         @ts-expect-error */}
--    ~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-         <MyComponent foo={"hooray"} />
-       </div>
-     );
++    ~~~~~~~~~~~~~~~~~~~~~~
++!!! error TS2578: Unused '@ts-expect-error' directive.
path: testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
user: login: haoqixu
body: I think this is because `tsgo` cannot find out the semantic error in the following `foo={100}` in `jsx` yet. :thinking: 
created_at: 2025-03-12T11:22:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,48 +1,40 @@
 --- old.multiline.errors.txt
 +++ new.multiline.errors.txt
 @@= skipped -0, +0 lines =@@
--a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
--b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
-+a.ts(5,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-+a.ts(9,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
+ a.ts(12,1): error TS2578: Unused '@ts-expect-error' directive.
 +b.tsx(1,24): error TS2307: Cannot find module 'react' or its corresponding type declarations.
++b.tsx(17,1): error TS2578: Unused '@ts-expect-error' directive.
++b.tsx(28,6): error TS2578: Unused '@ts-expect-error' directive.
+ b.tsx(32,1): error TS2578: Unused '@ts-expect-error' directive.
  
  
--==== a.ts (1 errors) ====
-+==== a.ts (2 errors) ====
-     export const texts: string[] = [];
-     
-     /**
-      @ts-ignore */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
-     texts.push(100);
-+               ~~~
-+!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
-     
-     /**
-      @ts-expect-error */
--    ~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
+@@= skipped -18, +21 lines =@@
+ !!! error TS2578: Unused '@ts-expect-error' directive.
      texts.push("100");
      
- ==== b.tsx (1 errors) ====
+-==== b.tsx (1 errors) ====
++==== b.tsx (4 errors) ====
      import * as React from "react";
 +                           ~~~~~~~
 +!!! error TS2307: Cannot find module 'react' or its corresponding type declarations.
      
      export function MyComponent(props: { foo: string }) {
        return <div />;
-@@= skipped -51, +56 lines =@@
+@@= skipped -18, +20 lines =@@
      
          {/*
         @ts-expect-error */}
--    ~~~~~~~~~~~~~~~~~~~~~~
--!!! error TS2578: Unused '@ts-expect-error' directive.
-         <MyComponent foo={"hooray"} />
-       </div>
-     );
++    ~~~~~~~~~~~~~~~~~~~~~~
++!!! error TS2578: Unused '@ts-expect-error' directive.
path: testdata/baselines/reference/submodule/conformance/multiline.errors.txt.diff
user: login: jakebailey
body: Oh that's very possible, yes.
created_at: 2025-03-12T11:33:53Z
author_association: MEMBER

PR comments:
user: login: haoqixu
created_at: 2025-03-12T07:35:41Z
body: @microsoft-github-policy-service agree
author_association: CONTRIBUTOR