Thanks to visit codestin.com
Credit goes to github.com

Skip to content

no-new-object to allow argument #11810

@brettz9

Description

@brettz9

What rule do you want to change?

no-new-object

Does this change cause the rule to produce more or fewer warnings?

Fewer warnings.

How will the change be implemented? (New option, new default behavior, etc.)?

New default behavior.

Please provide some example code that this change will affect:

new Object(BigInt('1n'))

What does the rule currently do for this code?

Reports an error.

What will the rule do after it's changed?

Not report anything.

Are you willing to submit a pull request to implement this change?

Yes.

As per the above example, there are uses for wrapping some items within a new Object() (or within the equivalent, Object(), but some prefer the style of requiring new in such cases, as per unicorn/new-for-builtins).

If it is thought that people will like to make this optional, I can modify to something like allowWithArguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueenhancementThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions