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

Allow extra indentation for long conditionals #6

Closed
joshbetz opened this issue Oct 24, 2018 · 1 comment
Closed

Allow extra indentation for long conditionals #6

joshbetz opened this issue Oct 24, 2018 · 1 comment

Comments

@joshbetz
Copy link
Contributor

The combination of padded-blocks and indent rules make some blocks with long conditionals hard to read.

Example, I would expect this to be OK:

if ( conditionA && conditionB && conditionC &&
    conditionD && conditionE ) {
        doSomething();
}

Alternatively, not as good, but still somewhat readable:

if ( conditionA && conditionB && conditionC &&
    conditionD && conditionE ) {

    doSomething();
}

These are both not allowed. The first violates the indent rule and the second violates the padded-blocks rule. So we're forced to do:

if ( conditionA && conditionB && conditionC &&
    conditionD && conditionE ) {
    doSomething();
}

I personally think this is quite hard to read. I'm not sure if there's a super easy way to handle this as it doesn't seem there are options in either of these rules that account for this situation:

https://eslint.org/docs/rules/padded-blocks
https://eslint.org/docs/rules/indent

@github-actions
Copy link

github-actions bot commented Aug 15, 2022

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

This was referenced Sep 12, 2022
GaryJones added a commit to Automattic/fb-instant-articles that referenced this issue Sep 18, 2022
This pull request introduces a GitHub workflow that runs daily and will automatically mark inactive issues and PRs as stale. Keeping issues and pull requests manageable and actionable is important for a codebase's health.

The default behavior of this action will mark issues and pull requests as stale after **60 days** of inactivity, by adding a label of `[Status] Stale` and leaving an explanatory comment ([example](Automattic/eslint-config-wpvip#6 (comment))). This PR uses 30 days for this repository though, as there are a lot of outstanding issues. If another **7 days** of inactivity pass, it will be labeled `[Status] Autoclosed` and closed. (It can always be reopened, which resets the clock.)

This action ignores issues and PRs with the following labels:

- `[Pri] Critical`
- `[Status] Keep`
- `dependencies` (ensures that **Dependabot** pull requests are not marked as stale or closed)

Upon merging, this action will run at about midnight UTC. Issues and pull requests that already meet the stale threshold will be immediately marked stale, but will not be autoclosed until an additional 7 days of inactivity pass.
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

1 participant