-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[eslint-plugin-azure-sdk] New rule to make sure TSdoc comments for private members don't use internal tags #18761
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
|
Thank you for your contribution hamsa-s! We will review the pull request and get back to you soon. |
It seems like it's either some deeply nested object with array properties, or an object with circular reference that caused infinite recursive calls. |
|
Add @deyaaeldeen @witemple-msft in case either of you have any idea. The error message has |
|
@jeremymeng this error could happen if the import rule is going through a circular import statement but I am not sure how could this happen in this PR. |
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
|
Looking more closely, I think we are missing the reporting of the private members. We should be reporting when export class B {
/**
* @internal
*/
private x = 0;
/**
* @internal
*/
private get getter(): number { return 0 }
// other members.
}Having I found the following member nodes can have a visibility modifier, out of the possible TS syntax nodes:
I think we can match these nodes then checking for their accessibility and jsDoc. This is my current understanding of the original issue. Do we want to report the cases when Thoughts? @deyaaeldeen |
jeremymeng
left a 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.
Looking great! I have a few comments but overall it's good!
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/docs/rules/ts-doc-internal-private-member.md
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal-private-member.ts
Show resolved
Hide resolved
witemple-msft
left a 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 looks good! I have a couple of code style comments below.
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Outdated
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal-private-member.ts
Show resolved
Hide resolved
common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal-private-member.ts
Show resolved
Hide resolved
jeremymeng
left a 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.
Looks good other than two minor comments!
@deyaaeldeen @witemple-msft any additional feedback?
|
@jeremymeng this looks great! Thanks a lot @hamsa-s! |
jeremymeng
left a 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.
Looks great! Thank you very much for your contribution!
This fixes issue #13617. The new linter rule checks that private members don't use the internal tag in the TSdoc comments.
Here are the steps I took to solve the issue and write the new rule:
ts-doc-internal-private-member.tsto check if any private members use the internal tag in the TSdoc comments. I based this off ofts-doc-internal.tssince its purpose is similar but added checks for private members for the new ruletests/rulesdocs/rulessrc/configs/index.ts,src/rules/index.ts,tests/plugin.ts, andREADME.mdto add this new rule in the linterrush linton the entire repositoryPlease let me know if there is anything I missed or anything else I should do since I'm very new to this