Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
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
bf29b068
Commit
bf29b068
authored
Jan 19, 2020
by
gumen
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix @memberof description
parent
c323d83b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
devlog.txt
devlog.txt
+6
-0
jsdoc_parser.js
jsdoc_parser.js
+6
-1
tests/main.js
tests/main.js
+3
-1
timelog.org
timelog.org
+1
-0
No files found.
devlog.txt
View file @
bf29b068
...
...
@@ -209,3 +209,9 @@ dopiero na większym projekcie pełnym JSDocków.
Teraz obsługa opcji a na deser zamienię to wszystko w plugin. Taką
mam nadzieję.
nie, 19 sty 2020, 19:20:32 CET
Kończą mi się siły. Naprawiłem jeszcze drobne błędy i dodałem
brakującą dokumentację do jednej funkcji. Chyba na dzisiaj
wystarczy. Będzie łatwiej w pracy ogarnąć te opcje i plugin.
jsdoc_parser.js
View file @
bf29b068
...
...
@@ -55,6 +55,11 @@ function formatDescription(text) {
return
text
||
''
}
/**
* Control order of tags by weights. Smaller value brings tag higher.
* @param {String} tagTitle
* @return {Number} Tag weight
*/
function
getTagOrderWeight
(
tagTitle
)
{
var
tagsWeightMap
=
{
'
private
'
:
1
,
...
...
@@ -125,7 +130,7 @@ module.exports = function jsdocParser(text, parsers, options) {
}
}
if
(
tag
.
title
!==
'
example
'
)
tag
.
description
=
formatDescription
(
tag
.
description
)
if
(
!
[
'
example
'
,
'
memberof
'
].
includes
(
tag
.
title
)
)
tag
.
description
=
formatDescription
(
tag
.
description
)
if
(
!
tag
.
description
&&
!
[
'
example
'
,
'
private
'
].
includes
(
tag
.
title
))
tag
.
description
=
'
TODO.
'
return
tag
...
...
tests/main.js
View file @
bf29b068
...
...
@@ -47,6 +47,7 @@ test('Should format regular jsDoc', () => {
* @param {String} [defaultValue="defaultTest"] TODO
* @arg {Number|Null} [optionalNumber]
* @private
*@memberof test
* @examples
* var one = 5
* var two = 10
...
...
@@ -58,6 +59,7 @@ const testFunction = (text, defaultValue, optionalNumber) => true
const
expected
=
`/**
* @private
* @memberof test
* @description Function example description that was wrapped by hand so it have
* more then one line and don't end with a dot REPEATED TWO TIMES
* BECAUSE IT WAS EASIER to copy function example description that
...
...
@@ -81,7 +83,7 @@ const testFunction = (text, defaultValue, optionalNumber) => true
const testFunction = (text, defaultValue, optionalNumber) => true;
`
expect
(
result
).
toEqual
(
expected
)
expect
(
result
).
toEqual
(
expected
)
})
test
(
'
Should add empty line after @description and @example description if necessary
'
,
()
=>
{
...
...
timelog.org
View file @
bf29b068
* Golden Hour
:LOGBOOK:
CLOCK: [2020-01-19 nie 18:38]--[2020-01-19 nie 19:20] => 0:42
CLOCK: [2020-01-19 nie 15:55]--[2020-01-19 nie 16:38] => 0:43
CLOCK: [2020-01-19 nie 14:51]--[2020-01-19 nie 15:36] => 0:45
CLOCK: [2020-01-19 nie 09:35]--[2020-01-19 nie 10:21] => 0:46
...
...
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