Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-for-you

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-for-you

hapi style guide ESLint rule dealing with for loops

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
increased by24.42%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-for-you

Current Version Build Status via Travis CI Dependencies

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'.

Keywords

FAQs

Package last updated on 12 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc