JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsClassDeclaration { decorators: JsDecoratorList [], abstract_token: missing (optional), class_token: CLASS_KW@0..6 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { name_token: IDENT@6..8 "A" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), l_curly_token: L_CURLY@8..9 "{" [] [], members: JsClassMemberList [ JsBogusMember { items: [ L_BRACK@9..15 "[" [Newline("\n"), Whitespace(" ")] [], TsIndexSignatureParameter { binding: JsIdentifierBinding { name_token: IDENT@15..16 "a" [] [], }, type_annotation: TsTypeAnnotation { colon_token: COLON@16..18 ":" [] [Whitespace(" ")], ty: TsNumberType { number_token: NUMBER_KW@18..24 "number" [] [], }, }, }, R_BRACK@24..25 "]" [] [], TsTypeAnnotation { colon_token: COLON@25..27 ":" [] [Whitespace(" ")], ty: TsStringType { string_token: STRING_KW@27..33 "string" [] [], }, }, SEMICOLON@33..34 ";" [] [], ], }, ], r_curly_token: R_CURLY@34..36 "}" [Newline("\n")] [], }, ], eof_token: EOF@36..37 "" [Newline("\n")] [], } 0: JS_MODULE@0..37 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..36 0: JS_CLASS_DECLARATION@0..36 0: JS_DECORATOR_LIST@0..0 1: (empty) 2: CLASS_KW@0..6 "class" [] [Whitespace(" ")] 3: JS_IDENTIFIER_BINDING@6..8 0: IDENT@6..8 "A" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: (empty) 7: L_CURLY@8..9 "{" [] [] 8: JS_CLASS_MEMBER_LIST@9..34 0: JS_BOGUS_MEMBER@9..34 0: L_BRACK@9..15 "[" [Newline("\n"), Whitespace(" ")] [] 1: TS_INDEX_SIGNATURE_PARAMETER@15..24 0: JS_IDENTIFIER_BINDING@15..16 0: IDENT@15..16 "a" [] [] 1: TS_TYPE_ANNOTATION@16..24 0: COLON@16..18 ":" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@18..24 0: NUMBER_KW@18..24 "number" [] [] 2: R_BRACK@24..25 "]" [] [] 3: TS_TYPE_ANNOTATION@25..33 0: COLON@25..27 ":" [] [Whitespace(" ")] 1: TS_STRING_TYPE@27..33 0: STRING_KW@27..33 "string" [] [] 4: SEMICOLON@33..34 ";" [] [] 9: R_CURLY@34..36 "}" [Newline("\n")] [] 4: EOF@36..37 "" [Newline("\n")] [] -- index_signature_class_member_in_js.js:2:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Index signatures are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. 1 │ class A { > 2 │ [a: number]: string; │ ^^^^^^^^^^^^^^^^^^^^ 3 │ } 4 │ i TypeScript only syntax -- class A { [a: number]: string; }