Query module InvalidExport

name
Assignment to exports variable
description
Assigning to the special ‘exports’ variable only overwrites its value and does not export anything. Such an assignment is hence most likely unintentional.
kind
problem
problem.severity
warning
id
js/node/assignment-to-exports-variable
tags
maintainability frameworks/node.js external/cwe/cwe-563
precision
very-high

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

exportsAssign

Holds if assign assigns the value of nd to exportsVar, which is an exports variable

moduleExportsAssign

Holds if pw assigns the value of nd to module.exports.