# TS8003: 'export =' can only be used in TypeScript files.

> `export =` appears in a JavaScript file. Use `module.exports =` or an ES `export` instead.

## What it means

`export = value` is TypeScript's syntax for a CommonJS-style export 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
const config = { port: 3000 };
export = config;
```

## How to fix

- Write `module.exports = config;` in CommonJS, or `export default config;` in an ES module.
- Rename the file to `.ts` if it's meant to be TypeScript.

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