-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement eslint-plugin-jsdoc (only for loopback monorepo) #5375
Conversation
This checks that you write JSDocs correctly. Now you can see here that many are not well ... that's why the tests fail |
@frbuceta I suggest that we add the The jsdoc rule does not apply to most TS files. For example, the tsdoc can infer param and return types. Tsdoc discourages to specify types in comments for such elements. For example, /**
* @param x - X
* @param y - Y
*/
function (x: string, y: number) {
} It's perfectly fine for tsdcos, but jsdoc plugin complains that |
Recently, API Extractor was enhanced (fixed?) to recognize even shorter syntax: /**
* @param x Description of param x
* @param y Description of param y
*/
function (x: string, y: number) {
} See microsoft/tsdoc#206. (Other related discussions: #2933, microsoft/tsdoc#128.) Can we use eslint-plugin-tsdoc to validate our tsdoc comments? This plugin is officially recommented by tsdoc (see here). tsdoc is powering api-extractor that we are using to build our api docs. |
@frbuceta I love the idea of linting our tsdoc comments ❤️ I am never sure if I am writing those comments correctly and most of the time I am too lazy to check how they are rendered in our API docs, so having an automated linter would be great 👏 |
Yes, I realized that. I would say it's a fix :-). |
I close this? @raymondfeng is doing it in another PR |
I love that you like it |
I think that would be best. You can always reopen this PR in the future in case #5435 goes nowhere. |
Today I changed editor and I have noticed that the JSDoc are not good in some cases. So I want you to think what you think of this.
It is only for the monorepo, not for the general configuration @strongloop/loopback-maintainers
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈