esm: make enhancements to example loader fixture
- Add JSDoc typings to function boundaries
- Remove import of URL & process as they are unnecessary
- Update bare-specifier check to match language used in error
- Improve accuracy of hook's thrown error message
- Move destructuring assignment of default to within function
Refs: https://github.com/nodejs/node/pull/31303
/cc @nodejs/modules-active-members
Checklist
-
tests and/or benchmarks are included (out of band) -
documentation is changed or added -
commit message follows commit guidelines