Closed Dan503 closed 2 years ago
Yes, I also find this plugin to format /** @file A file description */
as /** @file A File description */
So we have to just capitalise the y? to solve the bug
No the issue is that it is forcing a capital letter where there shouldn't be one.
Correct English is: "Are you sure?"
The bug is that it is forcing incorrect capitalisation on the 2nd word. "Are You sure?"
I want it to just let me handle my own capitalisation of words in this situation.
This module recognized are
is default value and others are description, this is reason of capitalizing 2nd word.
Can the capitalising of the first letter of the description feature just be removed from this plugin then?
I don't see it as an essential feature and I get the feeling that the code needed to know if it should or should not apply capitalisation would be super complicated and bug prone.
Maybe we should do this with a configuration and set the default to false.
false mean: do not capitalize
It could be called descriptionCapitalization
... might be a bit wordy though at least it's clear.
desCaps
is shorter but less clear
I forgot that, we have it with jsdocCapitalizeDescription
name
There is one thing that the plugin can do here to prevent some unwanted capitalisation.
@default 'Are you sure?'
I have quote marks around the text here. The plugin should be able to recognize that the full text inside the quote marks is the value and the text after the quote marks is the description.
@default 'I am a value' I am the description
So I think the bug here is that it shouldn't capitalise text inside 'single quote'
, "double quote"
, or `backtick quote`
.
Can you reopen the issue?
The quote marks issue stated in my previous comment is a valid bug.
I tried setting this in my prettierrc file and it didn't work :(
"jsdocCapitalizeDescription": false
{
"printWidth": 120,
"tabWidth": 4,
"singleQuote": true,
"semi": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"jsdocParser": true,
"jsdocCapitalizeDescription": false
}
I also tried this
{
"printWidth": 120,
"tabWidth": 4,
"singleQuote": true,
"semi": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"jsdocParser": true,
"plugins": [
"./node_modules/prettier-plugin-jsdoc"
],
"overrides": [
{
"files": "*.tsx, *.ts, *.js",
"options": {
"jsdocCapitalizeDescription": false
},
},
],
}
There is one thing that the plugin can do here to prevent some unwanted capitalisation.
@default 'Are you sure?'
I have quote marks around the text here. The plugin should be able to recognize that the full text inside the quote marks is the value and the text after the quote marks is the description.
@default 'I am a value' I am the description
So I think the bug here is that it shouldn't capitalise text inside
'single quote'
,"double quote"
, or`backtick quote`
.
Default tag has optional value if you want to declare value, you should keep it in {here}
for example
/**
* @deffault {true} default value is true
*/
This is not supported by vs code.
If you have an object as default value, how you can add it to jsdoc?
Objects are painful in jsDoc.
/**
* @param {Object} numberObject
* @param {number} numberObject.number - the number to add 1 to
*/
const add1 = numberObject => numberObject.number + 1
https://jsdoc.app/tags-default.html this is jsdoc default
documentation, but in syntax, there is no description
On the other hand, VS Code rendering default tag like example tag.
Yes, I also find this plugin to format
/** @file A file description */
as/** @file A File description */
I fixed this
Fixed V0.3.33
When I write this:
I get unwanted capitalisation in the
@default
tag. It says "Are You sure?" instead of "Are you sure?"