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",
18 category: "Best Practices",
20 url: "https://eslint.org/docs/rules/no-new-wrappers"
26 noConstructor: "Do not use {{fn}} as a constructor."
35 const wrapperObjects = ["String", "Number", "Boolean"];
37 if (wrapperObjects.indexOf(node.callee.name) > -1) {
40 messageId: "noConstructor",
41 data: { fn: node.callee.name }