]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/rules/no-new-wrappers.js
b697d8d7951f7cb16e4e3593886812688b04865d
2 * @fileoverview Rule to flag when using constructor for wrapper objects
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
17 description
: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
19 url
: "https://eslint.org/docs/rules/no-new-wrappers"
25 noConstructor
: "Do not use {{fn}} as a constructor."
34 const wrapperObjects
= ["String", "Number", "Boolean"];
36 if (wrapperObjects
.indexOf(node
.callee
.name
) > -1) {
39 messageId
: "noConstructor",
40 data
: { fn
: node
.callee
.name
}