Files
dewedev/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md
dwindown 7f2dd5260f Initial commit: Developer Tools MVP with visual editor
- Complete React app with 7 developer tools
- JSON Tool with visual structured editor
- Serialize Tool with visual structured editor
- URL, Base64, CSV/JSON, Beautifier, Diff tools
- Responsive navigation with dropdown menu
- Dark/light mode toggle
- Mobile-responsive design with sticky header
- All tools working with copy/paste functionality
2025-08-02 09:31:26 +07:00

1.4 KiB

import/no-mutable-exports

Forbids the use of mutable exports with var or let.

Rule Details

Valid:

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

...whereas here exports will be reported:

export let count = 2
export var count = 3

let count = 4
export { count } // reported here

Functions/Classes

Note that exported function/class declaration identifiers may be reassigned, but are not flagged by this rule at this time. They may be in the future, if a reassignment is detected, i.e.

// possible future behavior!
export class Counter {} // reported here: exported class is reassigned on line [x].
Counter = KitchenSink // not reported here unless you enable no-class-assign

// this pre-declaration reassignment is valid on account of function hoisting
getCount = function getDuke() {} // not reported here without no-func-assign
export function getCount() {} // reported here: exported function is reassigned on line [x].

To prevent general reassignment of these identifiers, exported or not, you may want to enable the following core ESLint rules:

When Not To Use It

If your environment correctly implements mutable export bindings.