Hook for a JS library in a custom module not working drupal 8
Just wrong indentation. Dependencies need two spaces indentation:

ajax_form:
  version: 1
  js:
    js/ajax_form.js: {}
  dependencies:
    - core/jquery