Skip to content
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

Avoid adding types to jsdocs for TS files #24077

Closed
Tyriar opened this issue Sep 9, 2024 · 3 comments · Fixed by #24300
Closed

Avoid adding types to jsdocs for TS files #24077

Tyriar opened this issue Sep 9, 2024 · 3 comments · Fixed by #24300
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc. good first issue needs PR Ready to be worked on

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 9, 2024

This {SplitLinesOptions=} isn't needed for example and just adds potential for bitrot:

* @param {SplitLinesOptions=} splitOptions - Options used for splitting the string.
*/
export function splitLines(
source: string,
splitOptions: SplitLinesOptions = { removeEmptyEntries: true, trim: true },

@Tyriar Tyriar added the debt Covers everything internal: CI, testing, refactoring of the codebase, etc. label Sep 9, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 9, 2024
@Tyriar
Copy link
Member Author

Tyriar commented Sep 9, 2024

Another example:

* @export
* @class SynchronousTerminalService
* @implements {ITerminalService}
* @implements {Disposable}

@karthiknadig karthiknadig added good first issue needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Sep 10, 2024
@brokoli777
Copy link

brokoli777 commented Oct 2, 2024

Hi! I would like to help with this, for the second example, it would be just be like this, right?

  * @export 
  * @class SynchronousTerminalService 
  * @implements ITerminalService
  * @implements Disposable

Is this issue only covering files under vscode-python/src/client/common/?

@Tyriar
Copy link
Member Author

Tyriar commented Oct 2, 2024

@brokoli777 the idea is to remove information that TS already knows about. So for the example SynchronousTerminalService all 4 lines would be removed since it's just repeating literally what's in the following line:

export class SynchronousTerminalService implements ITerminalService, Disposable {

karthiknadig pushed a commit that referenced this issue Oct 14, 2024
Fixes #24077

Removes redundant type annotations from JSDocs in TypeScript files where
the type is already inferred by TypeScript.

For example:

![image](https://github.com/user-attachments/assets/9ee1f0b6-f36f-4f4f-81dc-5178d46808cb)

Here I removed JSDoc types but I still kept all the useful information. 
I tried to be on the liberal side to avoid removing any comments that
provide useful context or clarify behavior. If I missed any or if more
can be removed, I’m happy to go over it again.

Additionally, if this issue only applies to a specific folder or scope,
please let me know so I can make the necessary adjustments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc. good first issue needs PR Ready to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants