Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
P
prettier-plugin-jsdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gumen
prettier-plugin-jsdoc
Commits
8c84bbad
Commit
8c84bbad
authored
Jan 25, 2020
by
VectorW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable yields for vertical alignment and add it to tests
parent
e2fec463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
jsdoc_parser.js
jsdoc_parser.js
+2
-2
tests/main.js
tests/main.js
+10
-2
No files found.
jsdoc_parser.js
View file @
8c84bbad
...
...
@@ -43,7 +43,7 @@ const vertiacallyAlignableTags = [
'
property
'
,
'
return
'
,
'
throws
'
,
//
'yields',
'
yields
'
,
]
/**
...
...
@@ -278,8 +278,8 @@ module.exports = {
'
examples
'
,
'
other
'
,
'
param
'
,
'
yields
'
,
'
throws
'
,
'
yields
'
,
'
return
'
,
]}],
description
:
'
Define order of tags.
'
,
...
...
tests/main.js
View file @
8c84bbad
...
...
@@ -160,28 +160,32 @@ test('Should not add TODO for return desc if it has undefined|null|void type', (
test
(
'
Should align v
artically param|property|return
|throws if option set to true
'
,
()
=>
{
test
(
'
Should align v
ertically param|property|return|yields
|throws if option set to true
'
,
()
=>
{
const
options
=
{
jsdocVerticalAlignment
:
true
}
const
Result1
=
subject
(
`/**
* @property {Object} unalginedProp unaligned property descriptin
* @param {String} unalginedParam unaligned param description
* @yields {Number} yields description
* @returns {undefined}
*/`
,
options
)
const
Expected1
=
`/**
* @property {Object} unalginedProp Unaligned property descriptin
* @param {String} unalginedParam Unaligned param description
* @yields {Number} Yields description
* @return {undefined}
*/
`
const
Result2
=
subject
(
`/**
* @throws {CustomExceptio} unaligned throws description
* @yields {Number} yields description
* @returns {String} unaligned returns description
*/`
,
options
)
const
Expected2
=
`/**
* @throws {CustomExceptio} Unaligned throws description
* @yields {Number} Yields description
* @return {String} Unaligned returns description
*/
`
...
...
@@ -190,7 +194,7 @@ test('Should align vartically param|property|return|throws if option set to true
expect
(
Result2
).
toEqual
(
Expected2
)
})
test
(
'
Should align v
artically param|property|return
|throws if option set to true, and amount of spaces is different than default
'
,
()
=>
{
test
(
'
Should align v
ertically param|property|return|yields
|throws if option set to true, and amount of spaces is different than default
'
,
()
=>
{
const
options1
=
{
jsdocVerticalAlignment
:
true
,
jsdocSpaces
:
2
...
...
@@ -199,6 +203,7 @@ test('Should align vartically param|property|return|throws if option set to true
* @property {Object} unalginedProp unaligned property descriptin
* @param {String} unalginedParam unaligned param description
* @throws {CustomExceptio} unaligned throws description
* @yields {Number} yields description
* @returns {undefined}
*/`
const
Result1
=
subject
(
unformattedJsdoc
,
options1
)
...
...
@@ -206,6 +211,7 @@ test('Should align vartically param|property|return|throws if option set to true
* @property {Object} unalginedProp Unaligned property descriptin
* @param {String} unalginedParam Unaligned param description
* @throws {CustomExceptio} Unaligned throws description
* @yields {Number} Yields description
* @return {undefined}
*/
`
...
...
@@ -218,6 +224,7 @@ test('Should align vartically param|property|return|throws if option set to true
* @property {Object} unalginedProp unaligned property descriptin
* @param {String} unalginedParam unaligned param description
* @throws {CustomExceptio} unaligned throws description
* @yields {Number} yields description
* @returns {String} unaligned returns description
*/`
,
options2
)
const
Expected2
=
`/**
...
...
@@ -227,6 +234,7 @@ test('Should align vartically param|property|return|throws if option set to true
* description
* @throws {CustomExceptio} Unaligned throws
* description
* @yields {Number} Yields description
* @return {String} Unaligned returns
* description
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment