> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-mutable-exports

[Added in v0.4.2](https://github.com/web-infra-dev/rslint/releases/tag/v0.4.2)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, importPlugin } from '@rslint/core';

export default defineConfig([
  importPlugin.configs.recommended,
  {
    rules: {
      'import/no-mutable-exports': 'error',
    },
  },
]);
```

## Rule Details

Forbids the use of mutable exports with `var` or `let`.

Mutable exports can lead to hard-to-understand code because importers might not expect the exported value to change after import. Use `const` for exported values, or export functions/classes instead.

Examples of **incorrect** code for this rule:

```javascript
export let count = 1;
export var count = 1;

let count = 1;
export { count };
```

Examples of **correct** code for this rule:

```javascript
export const count = 1;
export function getCount() {}
export class Counter {}

const count = 1;
export { count };
```

## Original Documentation

- [eslint-plugin-import: no-mutable-exports](https://github.com/import-js/eslint-plugin-import/blob/v2.32.0/docs/rules/no-mutable-exports.md)
- [Source code](https://github.com/import-js/eslint-plugin-import/blob/v2.32.0/src/rules/no-mutable-exports.js)
