# import/no-mutable-exports

> Disallow exporting a variable declared with `let` or `var`

An import is a live view of the exported variable. If the module assigns to an exported `let`, the value changes in every file that imported it, and nothing at the import tells you that. Code that copied the value keeps the old one, and code that reads it again gets the new one.

The variable is reported whether you export it where it's declared or later, with `export { count }` or `export default count`.

{/* 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]
"import/no-mutable-exports" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad */}
```js
export let count = 0;

export function increment() {
  count += 1;
}
```

{/* bad */}
```js
let count = 0;

export { count };
```

Not reported:

{/* good */}
```js
let count = 0;

export const getCount = () => count;

export function increment() {
  count += 1;
}
```
