the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

TS1002

Unterminated string literal.

TS1003

Identifier expected.

TS1005

'{0}' expected.

TS1009

Trailing comma not allowed.

TS1010

'*/' expected.

TS1011

An element access expression should take an argument.

TS1013

A rest parameter or binding pattern may not have a trailing comma.

TS1014

A rest parameter must be last in a parameter list.

2 Fixes
Related: TS1013

TS1015

Parameter cannot have question mark and initializer.

1 Fix
Related: TS1016

TS1016

A required parameter cannot follow an optional parameter.

2 Fixes
Related: TS1015

TS1017

An index signature cannot have a rest parameter.

TS1018

An index signature parameter cannot have an accessibility modifier.

TS1019

An index signature parameter cannot have a question mark.

TS1021

An index signature must have a type annotation.

TS1028

Accessibility modifier already seen.

TS1029

'{0}' modifier must precede '{1}' modifier.

TS1030

'{0}' modifier already seen.

TS1031

'{0}' modifier cannot appear on class elements of this kind.

TS1034

'super' must be followed by an argument list or member access.

TS1035

Only ambient modules can use quoted names.

TS1036

Statements are not allowed in ambient contexts.

TS1038

A 'declare' modifier cannot be used in an already ambient context.

TS1039

Initializers are not allowed in ambient contexts.

TS1040

'{0}' modifier cannot be used in an ambient context.

TS1042

'{0}' modifier cannot be used here.

1 Fix
Related: TS1040

TS1044

'{0}' modifier cannot appear on a module or namespace element.

TS1046

Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

TS1047

A rest parameter cannot be optional.

1 Fix
Related: TS1048

TS1048

A rest parameter cannot have an initializer.

1 Fix
Related: TS1047

TS1058

The return type of an async function must either be a valid promise or must not contain a callable 'then' member.

TS1068

Unexpected token. A constructor, method, accessor, or property was expected.

TS1084

Invalid 'reference' directive syntax.

TS1089

'{0}' modifier cannot appear on a constructor declaration.

TS1090

'{0}' modifier cannot appear on a parameter.

TS1091

Only a single variable declaration is allowed in a 'for...in' statement.