How can I get the content type name inside the hook_form_BASE_FORM_ID_alter() hook?
You can get the node from the form object.

use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */
function yourmodule_form_node_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  /* @var \Drupal\node\NodeInterface $node */
  $node = $form_state-&gt;getFormObject()-&gt;getEntity();

  if (!$node-&gt;getType() == 'article') {
    // ....
  }
}


Note that getEntity() doesn't exist on \Drupal\Core\Form\FormInterface, which is why it doesn't show up as a method in an IDE. It only exists on \Drupal\Core\Entity\EntityFormInterface, you can add an explicit instance of for that.