no-exports-assign
UnreleasedConfiguration
Disallow assignments to the global exports variable.
The node plugin ports this rule from eslint-plugin-n.
Rule Details
Assigning a new value to exports does not replace the value exported by a
CommonJS module. Assign to module.exports instead.
Examples of incorrect code:
Examples of correct code:
The rule checks assignment expressions, including compound assignments. It
allows a chained assignment when the immediately enclosing or right-hand
assignment targets the global module.exports. Computed access such as
module['exports'] does not qualify for this exception.
Only variables belonging to the global scope are checked. Local parameters,
imports, and other local bindings named exports are allowed.
Options
This rule has no options and provides no automatic fixes or suggestions.
Enable the bundled node plugin. CommonJS files supply exports and module
globals automatically; other source types can configure them explicitly: