# TS8011: Type arguments can only be used in TypeScript files.

> Type arguments like `f<string>()` appear in a JavaScript file. Remove them.

## What it means

Explicit type arguments on calls, `new` expressions and heritage clauses are TypeScript syntax
and can't appear in a `.js` file.

ts-r's parser reports this code when it reads `.js` files with tsc's rules for TypeScript syntax in JavaScript. `ts-r-check` doesn't report it yet: today it parses `.js` files with the plain JavaScript grammar and reports a syntax error at the same place instead.

## Example

```js
class Store extends Map<string, number> {}
```

## How to fix

- Remove the type arguments; describe them with JSDoc (`@extends {Map<string, number>}`) if you
  want them checked.
- Rename the file to `.ts` if it's meant to be TypeScript.

Source: https://ts-r.dev/errors/TS8011/
