# hapi-for-you

> hapi style guide ESLint rule dealing with for loops

Latest version **1.0.0** (published 2015-11-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hapi-for-you
pnpm add hapi-for-you
yarn add hapi-for-you
bun add hapi-for-you
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-11-12 |
| First published | 2015-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Continuation Labs |
| Maintainers | cjihrig |
| Keywords | eslint, rule, for, loop, for loop |

## Links

- npm: https://www.npmjs.com/package/hapi-for-you
- Repository: https://github.com/continuationlabs/hapi-for-you
- Issues: https://github.com/continuationlabs/hapi-for-you/issues
- npm.io page: https://npm.io/package/hapi-for-you

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-11-12

## README

# hapi-for-you

[![Current Version](https://img.shields.io/npm/v/hapi-for-you.svg)](https://www.npmjs.org/package/hapi-for-you)
[![Build Status via Travis CI](https://travis-ci.org/continuationlabs/hapi-for-you.svg?branch=master)](https://travis-ci.org/continuationlabs/hapi-for-you)
![Dependencies](http://img.shields.io/david/continuationlabs/hapi-for-you.svg)

hapi style guide ESLint rule dealing with for loops. This rule enforces the following:

- Restrict iterator variable names. `for` loop iterator variables should be named `i`. Nested loops should use the variables `j`, `k`, and so on.
- Restrict loop nesting.  You can restrict the maximum nesting of `for` loops. By default, this limit is three.
- 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.
- 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.

## Rule options

This rule can be configured by providing a single options object. The object supports the following keys.

### `maxDepth`

A number representing the maximum allowed nesting of `for` loops. Defaults to three.

### `startIterator`

The first variable iterator name to use. This defaults to `'i'`.

---
_Source: https://npm.io/package/hapi-for-you · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
