ESLint rule to enforce var declarations are only at the top of a function but excluding
for
loops.
Summary
This repository will give access to a modified vars-on-top
rule for the ESLint tool.
Usage
-
Install
eslint
as a dev-dependency:npm install --save-dev eslint -
Install
eslint-plugin-vars-on-top-without-for
as a dev-dependency:npm install --save-dev eslint-plugin-vars-on-top-without-for -
Enable the plugin by adding it to your
.eslintrc
:plugins:- vars-on-top-without-for