Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Allow increment in for loop statements #362

Closed
RussellSprouts opened this issue Apr 10, 2017 · 1 comment
Closed

Allow increment in for loop statements #362

RussellSprouts opened this issue Apr 10, 2017 · 1 comment
Labels
Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Milestone

Comments

@RussellSprouts
Copy link

Code like this is perfectly idiomatic and has little risk of causing an issue:

for (let i = 0; i < length; i++) {
  // ...
}

It would be nice to have an option to allow increment operators in this context.

@ChrisMBarr
Copy link
Contributor

Agreed. an option like allow-for-loops or ignore-for-loops would be useful here.

@JoshuaKGoldberg JoshuaKGoldberg added Status: Accepting PRs Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Type: Rule Feature Adding a feature to an existing rule. labels Jul 6, 2018
JoshuaKGoldberg pushed a commit that referenced this issue Nov 5, 2018
…542)

* Add an option to noIncrementDecrementRule to ignore for loop headers

* Disallow incrementors and decrementors in parts of the for loop header, other than the incrementor
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Medium People with non-trivial experience in TSLint should be able to send a pull request for this issue. Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Projects
None yet
Development

No branches or pull requests

3 participants