]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/rules/no-new-object.js
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",
25 url
: "https://eslint.org/docs/rules/no-new-object"
31 preferLiteral
: "The object literal notation {} is preferrable."
38 const variable
= astUtils
.getVariableByName(
43 if (variable
&& variable
.identifiers
.length
> 0) {
47 if (node
.callee
.name
=== "Object") {
50 messageId
: "preferLiteral"