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

Optionally allow bullet lists and other indented text in comments when check-indentation is enabled #541

Open
edg2s opened this issue May 14, 2020 · 0 comments

Comments

@edg2s
Copy link
Contributor

edg2s commented May 14, 2020

For example:

/**
 * Foobar
 *
 * This method does the following things:
 * - foo...
 *   this is the first step
 * - bar
 *   this is the second step
 */

Rather than looking for bullet lists explicitly, the option could cause the linter to only check the indentation of the first line (of each 'section'?):

/**
 * Allowed
 *   Indentation
 */

/**
 *   Disallowed
 *   Indentation
 */

This could also apply to tags with descriptions, instead of having to list them manually:

/**
 * @param {number} val Multi-
 *                     line
 */

/**
 *   @param {number} val Still disallowed
 */

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

mcmire added a commit to MetaMask/create-release-branch that referenced this issue Jul 8, 2022
* Assume that all JavaScript and TypeScript files are run in a Node
  context, and allow `process.env` to be accessed and `process.exit()`
  to be called freely.
* Prevent the JSDoc plugin from checking indentation. It's common to
  want to use a bulleted or numbered list in a JSDoc block and this rule
  prevents that. There is an issue open in the `eslint-plugin-jsdoc`
  repo for this but there doesn't seem to be any progress around this
  yet: <gajus/eslint-plugin-jsdoc#541>
* Tweak rules for blank lines. Currently we check that blank lines are
  inserted in between:

  * A directive prologue (like `use strict`) and anything else (except
    another directive prologue)
  * A multiline block-like statement (e.g. `if`, `while`, IIFEs, etc.)
    and a multiline expressions (e.g. multiline function calls)
  * A multiline block-like statement (e.g. `if`, `while`, IIFEs, etc.)
    and another multiline block-like statement
  * A multiline expression and a multiline block-like statement
  * A multiline expression and another multiline expression

  The issue is that enforcing line breaks in between multiline function
  or method calls makes organizing big integration tests more difficult.
  At the same time, multiline `if` statements more often than not
  involve some kind of complexity that would be unreadable smooshed up
  against some other code, so this commit also enforces empty line
  breaks around any kind of such statement.
mcmire added a commit to MetaMask/create-release-branch that referenced this issue Jul 12, 2022
* Assume that all JavaScript and TypeScript files are run in a Node
  context, and allow `process.env` to be accessed and `process.exit()`
  to be called freely.
* Prevent the JSDoc plugin from checking indentation. It's common to
  want to use a bulleted or numbered list in a JSDoc block and this rule
  prevents that. There is an issue open in the `eslint-plugin-jsdoc`
  repo for this but there doesn't seem to be any progress around this
  yet: <gajus/eslint-plugin-jsdoc#541>
* Tweak rules for blank lines. Currently we check that blank lines are
  inserted in between:

  * A directive prologue (like `use strict`) and anything else (except
    another directive prologue)
  * A multiline block-like statement (e.g. `if`, `while`, IIFEs, etc.)
    and a multiline expressions (e.g. multiline function calls)
  * A multiline block-like statement (e.g. `if`, `while`, IIFEs, etc.)
    and another multiline block-like statement
  * A multiline expression and a multiline block-like statement
  * A multiline expression and another multiline expression

  The issue is that enforcing line breaks in between multiline function
  or method calls makes organizing big integration tests more difficult.
  At the same time, multiline `if` statements more often than not
  involve some kind of complexity that would be unreadable smooshed up
  against some other code, so this commit also enforces empty line
  breaks around any kind of such statement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants