Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for tools. r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D155176
This commit is contained in:
Mark Banner 2022-08-26 13:39:38 +00:00
parent 365f6e8e10
commit 65b92de13b
7 changed files with 6 additions and 7 deletions

View File

@ -482,7 +482,6 @@ module.exports = {
"layout/**",
"netwerk/**",
"storage/test/unit/test_vacuum.js",
"tools/**",
"widget/tests/test_assign_event_data.html",
],
rules: {

View File

@ -188,7 +188,7 @@ module.exports = {
},
leave(node, parent) {
if (parents.length == 0) {
if (!parents.length) {
throw new Error("Left more nodes than entered.");
}
parents.pop();

View File

@ -43,7 +43,7 @@ module.exports = {
if (
callee.type !== "Identifier" ||
callee.name !== "Date" ||
node.arguments.length > 0
node.arguments.length
) {
return;
}

View File

@ -57,7 +57,7 @@ async function test_with_filter(fnFilterWithContentId) {
const profile = await waitSamplingAndStopAndGetProfile();
await TestUtils.waitForCondition(async function() {
return (await GetPidsWithSamplerThread()).length == 0;
return !(await GetPidsWithSamplerThread()).length;
}, "Wait for all sampler threads to stop after profiler stop");
return { contentPid, pidsWithSamplerThread, profile };

View File

@ -30,7 +30,7 @@ add_task(async () => {
delayMS *= 2;
if (thread0.samples.data.length == 0) {
if (!thread0.samples.data.length) {
continue;
}

View File

@ -27,7 +27,7 @@ add_task(async () => {
// Check for FileIO in any of the background threads.
if (thread.name.startsWith("BgIOThreadPool")) {
const markers = getInflatedFileIOMarkers(thread, filename);
if (markers.length > 0) {
if (markers.length) {
backgroundThread = thread;
backgroundThreadFileIO = markers;
break;

View File

@ -42,7 +42,7 @@ var apply = () => {
updateLabels();
if (
Object.keys(filters).length == 0 ||
!Object.keys(filters).length ||
(Object.keys(filters).length == 1 && "build_type" in filters)
) {
selection.value = "";