-
-
Notifications
You must be signed in to change notification settings - Fork 528
Do not append trailing spaces to JSDoc tags #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: b3c3508 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7878da3
to
3a9b1bb
Compare
if (v.format) output.push(`Format: ${v.format} `); | ||
if (v.title) output.push(v.title); | ||
if (v.summary) output.push(v.summary); | ||
if (v.format) output.push(`Format: ${v.format}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment
function already does the job of adding a trailing space in case of a single-line comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is such a small detail but has a really big impact! Thank you for fixing this.
"lint": "run-p -s lint:*", | ||
"lint:js": "eslint \"src/**/*.{js,ts}\"", | ||
"lint:prettier": "prettier --check \"src/**/*\"", | ||
"lint:js": "eslint 'src/**/*.{js,ts}'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lint:js": "eslint 'src/**/*.{js,ts}'", | |
"lint:js": "eslint \"src/**/*.{js,ts}\"", |
We actually want to keep the escaped double quotes. Though *nix and mac users can run this just fine, IIRC Windows contributors run into problems with single quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is such a minor thing, I’ll revert this after merge, but won’t touch anything else. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that I always work on a UNIX OS and though the scripts without escaped quotes look nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no worries at all. I did the same thing until I had Windows users complain 😛 (and I agree with you)
@@ -55,13 +55,13 @@ export function getSchemaObjectComment(v: CommentObject, indentLv?: number): str | |||
const output: string[] = []; | |||
|
|||
// * Not JSDOC tags: [title, format] | |||
if (v.title) output.push(`${v.title} `); | |||
if (v.summary) output.push(`${v.summary} `); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of these string escapes mostly came from fields that could contain non-strings, but I think that was really only example
. I don’t see the harm in removing the string escapes.
@@ -112,4 +112,60 @@ describe("utils", () => { | |||
expect(escObjKey("_ref_")).toStrictEqual("_ref_"); | |||
}); | |||
}); | |||
|
|||
describe("comment", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great tests 👏
Before:
After: