no-new
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-new": "error",
},
},
];new Thing();const thing = new Thing();
Foo();Examples from the ESLint documentation.
no-new
eslint
export default [
{
rules: {
"no-new": "error",
},
},
];no-new
eslint plugin · suspicious
{
"rules": {
"no-new": "error"
}
}correctness/noUnusedInstantiation
correctness · since 2.3.12
{
"linter": {
"rules": {
"correctness": {
"noUnusedInstantiation": "error"
}
}
}
}Require or disallow Unicode byte order mark (BOM)
Disallow unnecessary computed property keys in objects and classes
Disallow throwing literals as exceptions
Enforce variables to be declared either together or separately in functions