2 * @fileoverview A rule to disallow calls to the Object constructor
3 * @author Matt DuVall <http://www.mattduvall.com/>
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const astUtils = require("./utils/ast-utils");
14 //------------------------------------------------------------------------------
16 //------------------------------------------------------------------------------
23 description: "disallow `Object` constructors",
24 category: "Stylistic Issues",
26 url: "https://eslint.org/docs/rules/no-new-object"
32 preferLiteral: "The object literal notation {} is preferrable."
39 const variable = astUtils.getVariableByName(
44 if (variable && variable.identifiers.length > 0) {
48 if (node.callee.name === "Object") {
51 messageId: "preferLiteral"