Skip to content

Add lint rule to warn against object comparison #1446

@iShibi

Description

@iShibi

Hi! May be this is a skill issue but I keep making a mistake of comparing objects. It will be nice to have a lint rule that we can enable so that object comparison using === shows a warning.

const hex8 = new Hex8('0x00');
const anotherHex8 = new Hex8('0x00');

// This object comparison should show a warning
if (hex8 === anotherHex8) {
	//
}

// This is the correct way to check where value is a primitive
if (hex8.value === anotherHex8.value) {
	//
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions