Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-incorrect-deep-equal rule #264

Merged

Conversation

MrHen
Copy link
Contributor

@MrHen MrHen commented Jun 15, 2019

Closes #158.

Does not cover t.deepEqual(1, expression); // ? situations. Does not fix back to deepEqual if it detects a non-literal in is -- I felt that would be an ambiguous situation in the event that someone actually wanted to compare by reference.

@sindresorhus sindresorhus changed the title Add no-incorrect-deep-equal rule Add no-incorrect-deep-equal rule Jul 1, 2019
@sindresorhus
Copy link
Member

Does not cover t.deepEqual(1, expression); // ? situations.

I think it should handle that, as long as the first or second argument is a literal primitive.

Does not fix back to deepEqual if it detects a non-literal in is -- I felt that would be an ambiguous situation in the event that someone actually wanted to compare by reference.

👍

docs/rules/no-incorrect-deep-equal.md Outdated Show resolved Hide resolved
docs/rules/no-incorrect-deep-equal.md Outdated Show resolved Hide resolved
test/no-incorrect-deep-equal.js Outdated Show resolved Hide resolved
MrHen and others added 3 commits July 2, 2019 13:20
readme.md Outdated Show resolved Hide resolved
rules/no-incorrect-deep-equal.js Outdated Show resolved Hide resolved
test/no-incorrect-deep-equal.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit ff4f760 into avajs:master Jul 6, 2019
@sindresorhus
Copy link
Member

@MrHen Nice work as usual 👌

@MrHen MrHen deleted the feature/158-no-incorrect-deep-equal branch July 6, 2019 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule proposal: No deepEqual for primitives values
2 participants