diff --git a/packages/js/jsdoc/README.md b/packages/js/jsdoc/README.md index 9188c218..51b33b2e 100644 --- a/packages/js/jsdoc/README.md +++ b/packages/js/jsdoc/README.md @@ -55,7 +55,7 @@ Plugins implemented elsewhere, that are bundled here for easier use ### Event emitters descriptions [`woocommerce-grow-tracking-jsdoc/fires-description`](https://github.com/woocommerce/grow/tree/add/jsdoc/packages/js/tracking-jsdoc#emitters) -To document what or when is emitted with `@fires` or `@emmits`. +To document what or when is emitted with `@fires` or `@emits`. #### Imported types `jsdoc-plugin-typescript` diff --git a/packages/js/tracking-jsdoc/README.md b/packages/js/tracking-jsdoc/README.md index d6740367..a4107897 100644 --- a/packages/js/tracking-jsdoc/README.md +++ b/packages/js/tracking-jsdoc/README.md @@ -39,12 +39,12 @@ You may add any of the following properties to your JSDoc config (`.jsdocrc.json Then make sure `jsdoc` uses it, by `jsdoc -r your/source/files/ -c .jsdocrc.json`. ## Emitters -If you would like to add some descriptions to `@fires` or `@emmits` tags, for example to specify what data is attached to the event, add `fires-description` to your plugins list: +If you would like to add some descriptions to `@fires` or `@emits` tags, for example to specify what data is attached to the event, add `fires-description` to your plugins list: ```json { "plugins": [ - // To be able to add descriptions to `@fires` & `@emmits` + // To be able to add descriptions to `@fires` & `@emits` "woocommerce-grow-tracking-jsdoc/fires-description" ], // … diff --git a/packages/js/tracking-jsdoc/fires-description.js b/packages/js/tracking-jsdoc/fires-description.js index 0d484171..c87f40df 100644 --- a/packages/js/tracking-jsdoc/fires-description.js +++ b/packages/js/tracking-jsdoc/fires-description.js @@ -1,5 +1,5 @@ /** - * JSDoc plugin that allows to use descriptions for built-in `@fires` & `@emmits` tags. + * JSDoc plugin that allows to use descriptions for built-in `@fires` & `@emits` tags. * * Overwrites the standard definition with `canHaveName: true` option, * and tweaks `applyNamespace` to apply it only to `value.name`. @@ -7,15 +7,13 @@ const { applyNamespace } = require( 'jsdoc/name' ); exports.defineTags = function ( dictionary ) { - dictionary - .defineTag( 'fires', { - mustHaveValue: true, - canHaveName: true, - onTagged( doclet, tag ) { - doclet.fires = doclet.fires || []; - tag.value.name = applyNamespace( tag.value.name, 'event' ); - doclet.fires.push( tag.value ); - }, - } ) - .synonym( ' emmits' ); + dictionary.defineTag( 'fires', { + mustHaveValue: true, + canHaveName: true, + onTagged( doclet, tag ) { + doclet.fires = doclet.fires || []; + tag.value.name = applyNamespace( tag.value.name, 'event' ); + doclet.fires.push( tag.value ); + }, + } ); };