Skip to content

Commit

Permalink
chore(ESLint): enable no-unused-expressions rule (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jan 2, 2021
1 parent 9ee60cc commit fc2c7d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Expand Up @@ -23,6 +23,7 @@
}
],
"no-shadow": 2,
"no-unused-expressions": 2,
"no-useless-call": 2,
"no-use-before-define": [2, "nofunc"],
"no-void": 2,
Expand Down
36 changes: 18 additions & 18 deletions benchmark/benchmark.js
Expand Up @@ -17,12 +17,12 @@ if (process.argv.indexOf('--cheerio-only') >= 0) {

suites.add('Select all', 'jquery.html', {
test: function ($) {
$('*').length;
return $('*').length;
},
});
suites.add('Select some', 'jquery.html', {
test: function ($) {
$('li').length;
return $('li').length;
},
});

Expand Down Expand Up @@ -142,127 +142,127 @@ suites.add('traversing - Find', 'jquery.html', {
return $('li');
},
test: function ($, $lis) {
$lis.find('li').length;
return $lis.find('li').length;
},
});
suites.add('traversing - Parent', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.parent('div').length;
return $lis.parent('div').length;
},
});
suites.add('traversing - Parents', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.parents('div').length;
return $lis.parents('div').length;
},
});
suites.add('traversing - Closest', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.closest('div').length;
return $lis.closest('div').length;
},
});
suites.add('traversing - next', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.next().length;
return $lis.next().length;
},
});
suites.add('traversing - nextAll', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.nextAll('li').length;
return $lis.nextAll('li').length;
},
});
suites.add('traversing - nextUntil', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.nextUntil('li').length;
return $lis.nextUntil('li').length;
},
});
suites.add('traversing - prev', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.prev().length;
return $lis.prev().length;
},
});
suites.add('traversing - prevAll', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.prevAll('li').length;
return $lis.prevAll('li').length;
},
});
suites.add('traversing - prevUntil', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.prevUntil('li').length;
return $lis.prevUntil('li').length;
},
});
suites.add('traversing - siblings', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.siblings('li').length;
return $lis.siblings('li').length;
},
});
suites.add('traversing - Children', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.children('a').length;
return $lis.children('a').length;
},
});
suites.add('traversing - Filter', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.filter('li').length;
return $lis.filter('li').length;
},
});
suites.add('traversing - First', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.first().first().length;
return $lis.first().first().length;
},
});
suites.add('traversing - Last', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.last().last().length;
return $lis.last().last().length;
},
});
suites.add('traversing - Eq', 'jquery.html', {
setup: function ($) {
return $('li');
},
test: function ($, $lis) {
$lis.eq(0).eq(0).length;
return $lis.eq(0).eq(0).length;
},
});

Expand Down

0 comments on commit fc2c7d5

Please sign in to comment.