JavaScript

JavaScript

Made by DeepSource

Detected the assignment to exports JS-0256

Bug risk
Major

This rule is aimed at disallowing exports = {}, but allows module.exports = exports = {} to avoid conflict with node/exports-style rule's allowBatchAssign option.

Bad Practice

exports = {}

Recommended

module.exports.foo = 1
exports.bar = 2

module.exports = {}

// allows `exports = {}` if along with `module.exports =`
module.exports = exports = {}
exports = module.exports = {}