@@ -104,6 +104,11 @@ interface PluginDetails {
104104 *
105105 * @param url - Absolute path of plugin file as a `file://...` URL
106106 * @param packageName - Optional package name from `package.json` (fallback if `plugin.meta.name` is not defined)
107+ * @throws {* } If plugin throws during import
108+ * @throws {Error } If `plugin.meta.name` is `null` / `undefined` and `packageName` not provided
109+ * @throws {TypeError } If one of plugin's rules is malformed, or its `createOnce` method returns invalid visitor
110+ * @throws {TypeError } if `plugin.meta.name` is not a string
111+ * @throws {Error } In debug build if plugin has already been registered
107112 * @returns Plugin details or error serialized to JSON string
108113 */
109114export async function loadPlugin ( url : string , packageName : string | null ) : Promise < string > {
@@ -121,11 +126,11 @@ export async function loadPlugin(url: string, packageName: string | null): Promi
121126 * @param url - Absolute path of plugin file as a `file://...` URL
122127 * @param packageName - Optional package name from `package.json` (fallback if `plugin.meta.name` is not defined)
123128 * @returns - Plugin details
124- * @throws {Error } If plugin has already been registered
125- * @throws {Error } If plugin has no name
129+ * @throws {* } If plugin throws during import
130+ * @throws {Error } If ` plugin.meta.name` is `null` / `undefined` and `packageName` not provided
126131 * @throws {TypeError } If one of plugin's rules is malformed, or its `createOnce` method returns invalid visitor
127132 * @throws {TypeError } if `plugin.meta.name` is not a string
128- * @throws {* } If plugin throws an error during import
133+ * @throws {Error } In debug build if plugin has already been registered
129134 */
130135async function loadPluginImpl ( url : string , packageName : string | null ) : Promise < PluginDetails > {
131136 if ( DEBUG ) {
0 commit comments