message: Simplify `remove-checks-tab`
diff: -/*
  -
  -*/
  -
  import select from 'select-dom';
  import * as pageDetect from 'github-url-detection';
  import features from '../libs/features';
  -function init(): false | void {
  - // If there's a settings tab, the current user can enable checks,
  - // so the tab should not be hidden
  - if (select.exists([
  - '.js-repo-nav [data-selected-links^="repo_settings"]', // In repos
  - '.pagehead-tabs-item[href$="/settings/profile"]' // In organizations
  - ])) {
  - return false;
  - }
  -
  +function init(): void {
  // Only remove the tab if it's not the current page and if it has 0 checks
  const checksCounter = select('.tabnav-tab[href$="/checks"]:not(.selected) .Counter');
  - if (checksCounter && checksCounter.textContent!.trim() === '0') {
  - checksCounter.parentElement!.remove();
  + if (checksCounter?.textContent!.trim() === '0') {
  + checksCounter?.parentElement!.remove();
  }
  }
  @@ -33,5 +20,8 @@ features.add({
  include: [
  pageDetect.isPR
  ],
  + exclude: [
  + pageDetect.isRepoWithAccess
  + ],
  init
  });
  