Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1// @strict: false
2// Illegal attempts to define optional methods
3
4var a: {
5 x()?: number; // error
6}
7
…lines 8–27 unchanged (20 lines)

After

1// @target: es2015
2// @strict: false
3// Illegal attempts to define optional methods
4
5var a: {
6 x()?: number; // error
7}
…lines 8–28 unchanged (21 lines)

Before

program
comment "// @strict: false"
comment "// Illegal attempts to define optional methods"
variable_declaration (+22 nodes collapsed)
interface_declaration
interface "interface"
type_identifier "I"
interface_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
class_declaration
class "class"
type_identifier "C"
class_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
interface_declaration (+23 nodes collapsed)
class_declaration (+23 nodes collapsed)
variable_declaration
var "var"
variable_declarator
identifier "b"
= "="
object
{ "{"
ERROR
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
literal_type
number "1"
comment "// error"
} "}"

After

program
comment "// @target: es2015"
comment "// @strict: false"
comment "// Illegal attempts to define optional methods"
variable_declaration (+22 nodes collapsed)
interface_declaration
interface "interface"
type_identifier "I"
interface_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
class_declaration
class "class"
type_identifier "C"
class_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
interface_declaration (+23 nodes collapsed)
class_declaration (+23 nodes collapsed)
variable_declaration
var "var"
variable_declarator
identifier "b"
= "="
object
{ "{"
ERROR
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
literal_type
number "1"
comment "// error"
} "}"