Repository: freeCodeCamp/freeCodeCamp
File: client/src/templates/Challenges/classic/editor.tsx (TypeScript)

Code before:
          ariaLabel:
            'Accessibility mode set to true. Press Ctrl+e to disable or press Alt+F1 for more options'
        });
      }

      return accessibility;
    };

    const setTabTrapped = (trapped: boolean, announce = true) => {
      setMonacoTabTrapped(trapped);
      store.set('monacoTabTrapped', trapped);
      if (announce) {
        ariaAlert(
          `${
            trapped
              ? t('learn.editor-alerts.tab-trapped')
              : t('learn.editor-alerts.tab-free')
          }`
        );
      }
    };

    // By default, Tab will be trapped in the monaco editor, so we only need to
    // check if the user has turned this off.
    if (!isTabTrapped()) {
      setTabTrapped(false, false);
    }

    const accessibilityMode = storedAccessibilityMode();
    editor.updateOptions({
      accessibilitySupport: accessibilityMode ? 'on' : 'auto'
    });

    document.fonts.ready
      .then(() => monaco.editor.remeasureFonts())
      .catch(err => console.error(err));

    // Focus should not automatically leave the 'Code' tab when using a keyboard
    // to navigate the tablist.
    if (!isMobileLayout || !isUsingKeyboardInTablist) {
      // Users who are using screen readers should not have to move focus from
      // the editor to the description every time they open a challenge.
      if (props.canFocus && !accessibilityMode) {
        focusIfTargetEditor();
      } else focusOnHotkeys();
    }
    // Removes keybind for intellisense
    // Private method - hopefully changes with future version
    // ref: https://github.com/microsoft/monaco-editor/issues/102
    /* eslint-disable */
    // @ts-ignore

Review comment (suggestion):
```suggestion
      setTabTrapped(false, { announce: false });
```
This reads a little nicer, I think.

Code after:
          ariaLabel:
            'Accessibility mode set to true. Press Ctrl+e to disable or press Alt+F1 for more options'
        });
      }

      return accessibility;
    };

    const setTabTrapped = (
      trapped: boolean,
      opts: { announce: boolean } = { announce: true }
    ) => {
      setMonacoTabTrapped(trapped);
      store.set('monacoTabTrapped', trapped);
      if (opts.announce) {
        ariaAlert(
          `${
            trapped
              ? t('learn.editor-alerts.tab-trapped')
              : t('learn.editor-alerts.tab-free')
          }`
        );
      }
    };

    // By default, Tab will be trapped in the monaco editor, so we only need to
    // check if the user has turned this off.
    if (!isTabTrapped()) {
      setTabTrapped(false, { announce: false });
    }

    const accessibilityMode = storedAccessibilityMode();
    editor.updateOptions({
      accessibilitySupport: accessibilityMode ? 'on' : 'auto'
    });

    document.fonts.ready
      .then(() => monaco.editor.remeasureFonts())
      .catch(err => console.error(err));

    // Focus should not automatically leave the 'Code' tab when using a keyboard
    // to navigate the tablist.
    if (!isMobileLayout || !isUsingKeyboardInTablist) {
      // Users who are using screen readers should not have to move focus from
      // the editor to the description every time they open a challenge.
      if (props.canFocus && !accessibilityMode) {
        focusIfTargetEditor();
      } else focusOnHotkeys();
    }
    // Removes keybind for intellisense
    // Private method - hopefully changes with future version