-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prettier-plugin-jsdoc): add option to add a separator line on @e…
- Loading branch information
Showing
5 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
const R = require('ramda'); | ||
|
||
/** | ||
* @typedef {import('../types').PJPExamplesOptions} PJPExamplesOptions | ||
* @typedef {import('../types').CommentTag} CommentTag | ||
*/ | ||
|
||
/** | ||
* Renders an `example` tag by just adding the code below the tag. | ||
* | ||
* @param {CommentTag} tag The tag to render. | ||
* @param {CommentTag} tag The tag to render. | ||
* @param {PJPExamplesOptions} options The options related to the `example` tags. | ||
* @returns {string[]} | ||
*/ | ||
const renderExampleTag = (tag) => [ | ||
const renderExampleTag = R.curry((tag, options) => [ | ||
`@${tag.tag}`, | ||
...((new Array(options.jsdocLinesBetweenExampleTagAndCode)).fill('')), | ||
...tag.description.split('\n'), | ||
]; | ||
]); | ||
|
||
module.exports.renderExampleTag = renderExampleTag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters