Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Fix FP S2428 (prefer-object-literal): Ignore circular reference assignments #391

@zloirock

Description

@zloirock
const O = {}; // => error  Declare one or more properties of this object inside of the object literal syntax instead of using separate statements  sonarjs/prefer-object-literal
O.self = O;

The problem is that we can't define self references in the object literal. Sure, it can be worked around - but the error in this case is not what is expected from this rule.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions