Add eqeqeq rule but require == for null

This commit is contained in:
Jamie Kyle 2022-09-14 14:40:44 -07:00 committed by GitHub
parent 64a4d2e717
commit 0086216c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 64 additions and 63 deletions

View file

@ -65,6 +65,7 @@ function cleanDataInner(
// functions but don't mark them as cleaned.
return undefined;
case 'object': {
// eslint-disable-next-line eqeqeq
if (data === null) {
return null;
}
@ -73,7 +74,7 @@ function cleanDataInner(
const result: CleanedArray = [];
data.forEach((item, index) => {
const indexPath = `${path}.${index}`;
if (item === undefined || item === null) {
if (item == null) {
pathsChanged.push(indexPath);
} else {
result.push(cleanDataInner(item, indexPath, pathsChanged));