How to add custom settings / attributes to a field
Ok, this is done with third party settings in hook form alter:

function my_module_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

  $entity = $form_state-&gt;getFormObject()-&gt;getEntity();

  $form['third_party_settings']['my_module']['my_field_setting'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('My custom field setting'),
    '#default_value' =&gt; $entity-&gt;getThirdPartySetting('my_module', 'my_field_setting'),
  );
}


...and that's it. So awesome.