Custom data-id wp_enqueue_script

script_loader_tag filter was introduced in WordPress 4.1:

<?php
add_filter( 'script_loader_tag', 'my_script_attributes', 10, 3 );

function my_script_attributes( $tag, $handle, $src )
{
    // change to the registered script handle, e. g. 'jquery'
    if ( 'MY_SCRIPT_HANDLE' === $handle ) {

        // add attributes of your choice
        $tag = '<script id="customID" data-name="customDataName" src="' . esc_url( $src ) . '"></script>';
    }

    return $tag;
}