Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

Commit ce1e258

Browse files
jarrodyelletsMarsup
authored andcommitted
Move readme to API (#6)
1 parent c34644b commit ce1e258

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

API.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
## About
3+
4+
This rule enforces the following:
5+
6+
- Restrict iterator variable names. `for` loop iterator variables should be named `i`. Nested loops should use the variables `j`, `k`, and so on.
7+
- Restrict loop nesting. You can restrict the maximum nesting of `for` loops. By default, this limit is three.
8+
- Prevent postfix increment and decrement operators. The hapi style guide does not allow postfix increment and decrement operators in `for` loop updates. The prefix version of these operators should be used instead.
9+
- Single variable declaration in initialization section. A single `var i = 0;` is allowed in the initialization section. This only applies to variable declarations, not assignments to existing variables. This means that `for (i = 0, j = 0)` is allowed if `i` and `j` are existing variables. Variable declarations involving destructuring are not allowed.
10+
11+
## Rule options
12+
13+
This rule can be configured by providing a single options object. The object supports the following keys.
14+
15+
### `maxDepth`
16+
17+
A number representing the maximum allowed nesting of `for` loops. Defaults to three.
18+
19+
### `startIterator`
20+
21+
The first variable iterator name to use. This defaults to `'i'`.

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,3 @@
55
hapi style guide ESLint rule dealing with for loops.
66

77
[![Build Status](https://travis-ci.org/hapijs/rule-for-loop.svg?branch=master)](https://travis-ci.org/hapijs/rule-for-loop)
8-
9-
## About
10-
11-
This rule enforces the following:
12-
13-
- Restrict iterator variable names. `for` loop iterator variables should be named `i`. Nested loops should use the variables `j`, `k`, and so on.
14-
- Restrict loop nesting. You can restrict the maximum nesting of `for` loops. By default, this limit is three.
15-
- Prevent postfix increment and decrement operators. The hapi style guide does not allow postfix increment and decrement operators in `for` loop updates. The prefix version of these operators should be used instead.
16-
- Single variable declaration in initialization section. A single `var i = 0;` is allowed in the initialization section. This only applies to variable declarations, not assignments to existing variables. This means that `for (i = 0, j = 0)` is allowed if `i` and `j` are existing variables. Variable declarations involving destructuring are not allowed.
17-
18-
## Rule options
19-
20-
This rule can be configured by providing a single options object. The object supports the following keys.
21-
22-
### `maxDepth`
23-
24-
A number representing the maximum allowed nesting of `for` loops. Defaults to three.
25-
26-
### `startIterator`
27-
28-
The first variable iterator name to use. This defaults to `'i'`.

0 commit comments

Comments
 (0)