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

Make the exported Options have more descriptions and examples. #211

Open
1 of 15 tasks
Aqzhyi opened this issue Oct 8, 2023 · 1 comment
Open
1 of 15 tasks

Make the exported Options have more descriptions and examples. #211

Aqzhyi opened this issue Oct 8, 2023 · 1 comment

Comments

@Aqzhyi
Copy link
Contributor

Aqzhyi commented Oct 8, 2023

I hope that import('prettier-plugin-jsdoc').Options can not only be type-checked, but also provide developers with more specific descriptions and examples.

Just like what is expressed in this picture, in VSCode, you only need to add JSDOC above the variable or property, and then you can get the description and example of that option by hovering over it with your mouse.

Doing so can save developers from having to constantly go back to GitHub to check the documentation. It also makes it easier for developers to configure options that suit their own needs.

Package
CleanShot 2023-10-08 at 08 44 18

App
CleanShot 2023-10-08 at 08 30 22

But I'm not sure if the experience of other IDEs besides VSCode can be consistent.

And if I do this and provide the PR, then I need to set master/tsconfig.json#L8.removeComment configuration to false; I would like to ask for your opinion on this matter.


memo:

  • jsdocSpaces: number;

  • jsdocPrintWidth?: number;

  • jsdocDescriptionWithDot: boolean;

  • jsdocDescriptionTag: boolean;

  • jsdocVerticalAlignment: boolean;

  • jsdocKeepUnParseAbleExampleIndent: boolean;

  • jsdocSingleLineComment: boolean;

  • jsdocCommentLineStrategy: "singleLine" | "multiline" | "keep";

      /*
      * @example
      *   // jsdocCommentLineStrategy: 'singleLine'
      *
      *   // input:
      *
      *   \/** https://github.com/changesets/changesets/blob/main/packages/cli/src/commit/index.ts *\/
      *
      *   // output:
      *
      *   \/**
      *     * https://github.com/changesets/changesets/blob/main/packages/cli/src/commit/index.ts
      *     *\/
      *
      * @example
      *   // jsdocCommentLineStrategy: 'multiline'
      *
      *   // input:
      *   \/**
      *     * https://github.com/changesets/changesets/blob/main/packages/cli/src/commit/index.ts
      *     *\/
      *
      *   // output:
      *
      *   \/** https://github.com/changesets/changesets/blob/main/packages/cli/src/commit/index.ts *\/
      */
      jsdocCommentLineStrategy: 'keep',
  • jsdocSeparateReturnsFromParam: boolean;

  • jsdocSeparateTagGroups: boolean;

  • jsdocAddDefaultToDescription: boolean;

  • jsdocCapitalizeDescription: boolean;

  • jsdocPreferCodeFences: boolean;

  • tsdoc: boolean;

  • jsdocLineWrappingStyle: "greedy";

@hosseinmd
Copy link
Owner

What you said is the mission of JSDoc, and definitely the others IDEs should also go in that direction.
LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants