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

Google style indentation #715

Closed
thernstig opened this issue Apr 27, 2021 · 5 comments · Fixed by #964
Closed

Google style indentation #715

thernstig opened this issue Apr 27, 2021 · 5 comments · Fixed by #964

Comments

@thernstig
Copy link

thernstig commented Apr 27, 2021

Motivation

Indentation matters for readability, especially having a consistent indentation of documentation. I want to be able to use google style indentation for @parameter and @return as an example.

Current behavior

This might be part of check-indentation but I could not get it work with it.

Desired behavior

I want this to be invalid:

  /**
   * Do something.
   *
   * @param {string} fooA - Some text
   * @param {string} fooB - If defined, it foos
   * a lot all day long.
   */

I want this to be valid (with the new rule)

  /**
   * Do something.
   *
   * @param {string} fooA - Some text
   * @param {string} fooB - If defined, it foos
   *     a lot all day long. // This has been double-indented (4 spaces, we use 2 spaces for indents)
   */

This is called google style indent. It makes it easier to read the documentation.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@thernstig
Copy link
Author

@brettz9 Is this hard to get in place? 😄

@brettz9
Copy link
Collaborator

brettz9 commented Jan 10, 2023

I don't think it would be too hard, especially on its own, but I think we'd want to integrate it into check-line-alignment, so that there would not be inconsistencies. We could avoid forcing users to use that rule's never or always options, while still enforcing a specific indent. Haven't been feeling too well, so not sure about implementing, unfortunately...

@thernstig
Copy link
Author

@brettz9 ok I hope you are feeling ok soon!

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 28, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 28, 2023
@brettz9
Copy link
Collaborator

brettz9 commented Jan 28, 2023

@thernstig : Would you mind taking #964 for a spin to see if it works well for you?

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 29, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 31, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 1, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 1, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 2, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
BREAKING CHANGE:

Will strip indents by default; set `wrapIndent` option to a whitespace string (e.g., of 2 spaces) to set the indent you wish after wrapping
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
BREAKING CHANGE:

Will strip indents by default; set `wrapIndent` option to a whitespace string (e.g., of 2 spaces) to set the indent you wish after wrapping
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 11, 2023
BREAKING CHANGE:

Will strip indents by default; set `wrapIndent` option to a whitespace string (e.g., of 2 spaces) to set the indent you wish after wrapping
brettz9 added a commit that referenced this issue Feb 11, 2023
BREAKING CHANGE:

Will strip indents by default; set `wrapIndent` option to a whitespace string (e.g., of 2 spaces) to set the indent you wish after wrapping
@github-actions
Copy link

🎉 This issue has been resolved in version 40.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants