# @typescript-eslint/no-useless-empty-export

> Disallow `export {}` in a file that is already a module

`export {}` exports nothing. Its only use is to turn a file without any `import` or `export` into a module, so that its top-level names stay out of the global scope. In a file that already has an `import` or another `export`, it does nothing.

`.d.ts` files aren't checked.

`--fix` removes the empty export.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"@typescript-eslint/no-useless-empty-export" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```ts
export const port = 3000;
export {};
```

{/* bad */}
```ts
import { serve } from "bun";

serve({ fetch: () => new Response("ok") });

export {};
```

Not reported:

{/* good */}
```ts
export const port = 3000;
```

Here `export {}` is what makes the file a module:

{/* good */}
```ts
const port = 3000;
console.log(port);

export {};
```
